How long does it take for a transaction to cancel without paying the gas fee to cancel?

self.ethereum1m ago
I went to buy an NFT but was beat by someone else because they paid a higher gas fee and now my txn is in pending mode, how long will it take for it to time out so I don't have to pay a gas fee to cancel it?