Mortgages, separations and divorces are generally complex and it’s worth getting on top of your situation as soon as you possibly can.
In the UK, if you have a mortgage in both of your names, you are jointly and solely liable to keep up the payments; this is referred to as joint and several liability. In the event of one of you ceasing those payments, your lender reserves the right to ask the paying partner to repay the outstanding amount in full.
However, if the mortgage is solely in the name of your ex and they’ve stopped paying it but you wish to stay living there, you will need to take over the payments or face possible eviction action from the lender. If you are married, you do have a right to make those mortgage payments if you wish and the lender must accept them.
If you are in a sticky situation regarding your rent or mortgage, seek professional advice at the earliest opportunity.