Typically when you fall asleep your brain puts your body into a temporary state of paralysis. This does not always affect you fully however, which is where people sleep walk and other such things like that. Similarly, your brain does not always wake up all at once, which is why it is possible to wake up and not be able to move for awhile.