Sorry if this is the wrong place for me to put this but it seems appropriate depending on the answers I get.

If I am in a dream, does the amount of time I am in the dream correlate with real life time? Meaning, can I have a dream that lasts 2 years? Because I have had a similar non-lucid dream where I lived through 2 years of an apocalyptic world but I'm hearing that they correlate. Can someone confirm this?
Thanks