How ask for permission to leave the room
If you are a student and would like to ask for permission to leave the room, what should you say? "May I ... the room?"
A couple of polite ways to say this are:
"May I be excused?"
"May I be excused to go to the bathroom?" (Only really used in school when your teacher needs to know where you are).
"May I please use the restroom?"
When you are with friends a simple "excuse me" with no explanation is perfectly acceptable.
Here's a link (it's not about asking for permission to leave) but it generally discusses the issue of asking for permissions. I hope it gives you more information :)