One widely held theory about the purpose of dreams is that they help you store important memories and things you've learned, get rid of unimportant memories, and sort through complicated thoughts and feelings. Research shows that sleep helps store memories.
Most experts believe we dream to assist the body with rest, repair and rejuvenation. Others speculate that we dream for psychological reasons: to reexamine the day's events, to reduce and relieve stress, and to provide an outlet for pent-up emotions.