The "term" of a mortgage refers to the amount of time the borrower is expected to take to pay it off — to bring it to term, or mortgage maturity. A mortgage with a 30-year term figures 360 monthly payments from the borrower to the lender. A 15-year mortgage term figures 180 monthly payments. When the mortgage comes to term, it has been paid off. This isn't to say the loan itself is paid off in equal monthly installments.
Over the duration of the loan, the borrower pays back the lender in installments. With a fixed-rate mortgage, the payments are equal over the entire course of the loan, although the way the payments are applied to the loan amount changes over time. For example, a 30-year fixed-rate mortgage for $100,000 US Dollars (USD) at 5.0% would be paid off in 360 installments of $536.82 USD. That is $100,000 USD in principal and around $93,000 USD in interest. If the mortgage had a 15-year term, the monthly payment would be $790.79 USD — a higher payment, but costing far less in interest over the term of the loan: around $42,000 USD.
At the beginning of the mortgage term, the $536.82 USD payments might be divided, with $100 USD applied to the principal loan amount and $436.82 USD to the $93,000 USD interest the bank will collect over the 30-year term. Over time, the ratio of principal to interest increases, and by the end of those 30 years, the principal payment might be $500 USD and the interest $36.82 USD. Regardless, the term never changes — unless the borrower pays extra, also known as prepaying, and specifies that the borrower should apply the extra funds to the loan principal.
There is another kind of mortgage term, with very different implications for the borrower, although the meaning is largely identical; this is the term on a balloon or interest-only mortgage. In such a setup, the "term" still indicates the loan payoff, but the borrower pays in far smaller increments — enough to cover interest or interest plus small portions of principal — and then must come up with the bulk of the loan amount at the very end instead of simply paying a final, equal monthly installment, as with a fixed-rate mortgage. Such an arrangement may seem short-sighted, but it can make sense for a borrower planning to sell within a few years.
The best mortgage term depends on the buyer's situation, and it is not necessarily a strictly financial decision. For a buyer planning to improve the property and sell, a balloon might make sense, since very little principal is paid off at the outset of a fixed-rate loan. Such a buyer needs to have an excellent sense of the market, however. If the loan term comes and he doesn't have a buyer for the property, he will have to come up with a lot of money, fast.
For fixed-rate mortgages, a shorter mortgage term is usually the better choice as far as the amount of interest paid. Not every buyer can come up with the higher monthly payment, however. Many fixed-rate borrowers aim for the best of both worlds, taking a long-term, 30-year fixed-rate mortgage, but sending extra principal payments whenever possible, so long as the mortgage contract carries no prepayment penalties.