I have had this problem many times. Sometimes I just close the door and go to sleep, careful not to kick the cat or anything. Well, that lasts for about an hour or two, and then he decides he's had enough and wants out of the room, so he wakes me up by scratching on the door. There's also the option of leaving the door open when you go to sleep so that he can leave when he wants, but if I do that then my dog will bust through the door in the morning and wake me up.

So usually I either move him out of the room, or I hang around for a while and hope he wakes up on his own and decides to leave before I go to sleep.