Many communities' implicit social contracts imply that it can be impolite to just leave in the middle of a party a person has been invited to.
If it's "I'm bored" but not "oh God, I hate this," a lot of folks will stick around to be kind to the party host.