Do you have to pay mortgage even your name is to on the mortgage?

If your name is not on the mortgage you are not legally liable for the loan as far as the bank is concerned. You could become liable through a divorce if it has been your home for you and your spouse.