Most residential mortgages issued since the 1980s include "due-on-sale" clauses, which are more broadly interpreted as due-on-transfer. This means that when the property transfers, either through sale or inheritance or other means, the loan becomes due in full. If you inherit a property with a mortgage, the due-on-sale clause can be triggered.
A mortgage is a secured debt. That means that the underlying asset, in this case the property, is the collateral. The relationship between the debt and the property continue after the death of the borrower. A mortgage, then, is not forgiven after death. It must still be paid or the lender will initiate a foreclosure to take possession of the property and then sell it to recapture the loan balance.
Due-on-sale clauses are included in most, but not all, mortgages. FHA mortgages before 1986 do not have due-on-sale clauses, nor do VA mortgages issued before 1988. When you inherit a home with a mortgage, review the promissory note and mortgage or deed to see if there is a due-on-sale clause. If there is none, you can assume the loan without lender approval. If there is a due-on-sale clause, the lender can demand that the loan be paid in full.
The Garner-St. Germain Depository Institutions Regulation Act of 1982 prohibits lenders from exercising the due-on-sale clause under a limited number of circumstances. These include transfers to a close relative such as a spouse or child who will live in the residence. The lender could still foreclose if loan payments are not made, but it could not demand payment in full based on the transfer.
If you inherit a property with a mortgage that has a due-on-sale clause and are not a close relative who will live in the home, you have a few options. You can sell the house to pay off the loan and will be entitled to the balance of funds. You can contact the lender, explain what has happened and ask if you can assume the loan. If the lender refuses to allow you to assume the loan, you can apply with any lender to refinance the property in your name. Or you can make the payments and wait until the lender gives you a demand letter. If you are lucky, the lender will never take any action. If you are not, the lender will send a demand letter and require you to fully repay the loan. The risk is that the lender will give you such little time to pay off the loan that you won't have enough time to either refinance or sell before it forecloses.