As inconvenient as this natural alarm clock can be, there's a simple physiological reason why you often have to pee right as you drift off to sleep. For starters, we know that the amount of urine your body produces decreases at night, according to MedlinePlus . That's why most people can hold their bladder for six to eight hours as they sleep without needing to get up and pee. However, if you've had a lot of liquid within two hours of going to sleep, then you might have to pee right at the time that you've already fallen asleep. And if you've been drinking caffeine or alcohol , both of those substances can stimulate urine production and delay the bladder-emptying process , making late-night wake-ups more likely.