Pee when you feel like it.
Gads, don't try holding toxins in you. The urge to pee is natural - don't fight your body.
I'll say 1-2 hours before sleep don't put anything in your mouth (only your toothbrush!).
By the way, drink only water, as coffee&tea makes me pee.