I think there's a name for the phenomon: sleep inertia. It is most likely to happen when waking out of Delta or REM sleep, the two "deepest" stages. Also, my thinking tends to be somewhat disoriented for about 5-10 minutes.. like if I had a dream about snakes in the fridge, I'd be afraid to open the fridge for quite some time feeling totally convinced that there really are snakes inside.

On a somewhat unrelated side note, once when my alarm went off, I didn't wake up but it trigger an alarm in my dream to go off! That alarm looked exactly like my alarm in real life and it took me at least 5 minutes struggling to try to turn off that alarm when I finally realized I was dreaming. Too bad I couldn't go on with the lucidity; the ringing of the alarm clearly suggested to me, even when I was asleep, that I had to be somewhere else quick..