I sometimes have friends over for dinner. I am an introvert & after they've been here for about 2-3 hours I wish for them to leave so I can relax a little before bed alone. Is there a polite way I can ask them to leave?
First, guests who (let's presume inadvertently) over stay their welcome is a very, very common thing, I have experience many times myself.
Is there a polite way I can ask them to leave?
Yes, but you may want to try sending 'signals' first. For example, you can say:
That was lovely, but I have to clean up and get to bed. Big day tomorrow!
Then make a lightly exaggerated show of resetting your space.
If that doesn't work, it's ok to ask, just don't be a jerk about it.
Can we call it a night? I'm very tired. Looking forward to the next time!
Your guests won't necessarily know you want them to leave without some form of communication.
There are lots of helpful articles on this very subject, way too many to cite here. Searching "how to get guests to leave" returns many results. Be careful, some may be much more direct than you are comfortable with.
This is an Interpersonal Skill you can practice by vocalizing some of the suggestions before you have guests again to find some that work for you.
Yes I like having friends over and it's very fun and entertaining but after many hours I feel tired and know the night is over.
For my friends, I tell them that it was fun having them at my house but I'm tired and have to go to bed.
If they are your friends this will not be a problem because you are telling them the truth. If they still do not wish to leave, I would not have that person in my house again.