I don’t think it will stop until the last coin is mined depends on the upcoming future generation anyways.. it could become competitive and maybe more expensive when more and more people gets into mining which might eventually increase the total hash rate and of course the difficulty but doesn't mean it will become unaffordable since mining pools allow to share rewards..
Hence, if miners reduces the total hash rate will drops and so will the difficulty to keep the balance.
Technically mining will not stop even after 2140 but what will stop will be coin which comes as the block reward, but mining will continue as the new blocks will contain the bitcoin transactions and the incentives then will no longer include the block reward again but only the transaction fees would be rely upon by the miners. The block mining will continue as it is needed for transaction propagation. Should mining stop then every onchain related to bitcoin will stop.
The only difference is that there is possibility of mining getting difficult in some areas due to high cost of materials and tools needed for mining, but should this persists and results into lower hashrates, the difficulty will adjust to simply accommodate the mining power. So difficult keeps the network stable without long variations no matter the hashrate