In the first 90 minutes of sleep, you go through deepening stages ranging from light sleep to deep sleep.
Then you enter a phase called REM sleep (REM is short for Rapid Eye Movement) During REM sleep, the rest of your body essentially becomes paralyzed. The release of certain neurotransmitters are shut down and your large muscles do not move.
Some people have abnormal REM sleep in which those neurotransmitters do not shut down, and they act out their dreams. Most of the dreams we vividly remember happen during REM, as our brain has higher activity during this phase.