I usually either a. Say, I’m sorry, I have to take a bath, get ready for X tomorrow, have to do X early, etc etc. Sorry, but I need to get to bed for X reason. (this works if you’re out and being hassled not to leave yet.)
OR b. Sometime during the evening, mention that there is something that you absolutely MUST do at a certain time.
Of course, there’s always C. Start playing Quake3 and swearing like a sailor at the bloodthirsty bits.