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

EthereumEthereum
$1,956.71
‑2.60%
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?