I leave when I want, and I almost always ghost if it's an actual party.
If it's a gathering with only my friend group, I will say bye to everyone. But if I don't know more than half the people there before that party, I'm just walking out when no one is paying attention.