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.