If your mortgage is in joint names, then you are considered to be jointly responsible for the payment of that debt. So, if your partner dies and there is still a balance owing on the mortgage, you must see to it that the payments continue to be made.
Your partner or spouse may or may not dictate in their Will, that a portion of funds from the estate be allocated to paying off the mortgage.
If no Will has been made however, the estate will be passed into intestacy and there is no guarantee that funds will be made available to you as the joint person on the mortgage, to help you pay it.
There is often a false expectation with the surviving spouse, that all debts belonging to their deceased partner, including the mortgage, are written off in the event of their death. Be aware that this is not the case and see legal help from a probate specialist if necessary.