If the common law applies (i.e. there is no statute that changes it) then it depends on if the item was lost, mislaid or abandoned. The US has statute law dealing with lost money but that is not the question here.
Property is generally deemed to have been lost if it is found in a place where the true owner likely did not intend to set it down, and where it is not likely to be found by the true owner. At common law, the finder of a lost item could claim the right to possess the item against any person except the true owner or any previous possessors.
Property is generally deemed to have been mislaid or misplaced if it is found in a place where the true owner likely did intend to set it, but then simply forgot to pick it up again. For example, a wallet found in a shop lying on a counter near a cash register will likely be deemed misplaced rather than lost. Under common law principles, the finder of a misplaced object has a duty to turn it over to the owner of the premises, on the theory that the true owner is likely to return to that location to search for his misplaced item. If the true owner does not return within a reasonable time (which varies considerably depending on the circumstances), the property becomes that of the owner of the premises.
Property is generally deemed to have been abandoned if it is found in a place where the true owner likely intended to leave it, but is in such a condition that it is apparent that he or she has no intention of returning to claim it. Abandoned property generally becomes the property of whoever should find it and take possession of it first, although some states have enacted statutes under which certain kinds of abandoned property – usually cars, wrecked ships and wrecked aircraft – escheat, meaning that they become the property of the state.
For your specifics:
If I purchase merchandise in a physical store, and then (accidentally or not) leave the merchandise at the store after I've paid for it, is the store allowed to resell that merchandise to another customer?
This would be mislaid property and if they cannot find you and you do not return to claim it after a reasonable time (which would be different for a Mars bar and a Boeing 747) then it is theirs and they can do what they want with it: including sell it to someone else.
How does this scenario differ from leaving personal items at the store that I purchased elsewhere?