I've had dreams that seem to last for days/months but the dreams are always really segmented. It's like watching a sport highlights program of a period of time. It only shows the most important parts then goes on. I think this could be how the brain breaks down time for you in the dream. Time isn't really perceptually effected, it's just broken down into a way that's easily swallowable.