There are several different factors that come into play when deciding how long a term to take on a mortgage loan: what can you afford to pay each month, how high or low interest rates are, and what kind of return your money can get elsewhere, to name just a few. Generally, the two main choices are either getting the shortest loan term possible or getting the longest loan term possible. One allows you to pay off the loan faster and thus, pay less interest while the other gives you more flexibility to invest in other, higher return assets.
A key thing to look for is if there is a prepayment penalty on the loan. If there is no prepayment penalty, then it could make more sense to choose a longer term with lower monthly payments, which you can then choose to pay off faster if you would like to. What a longer term does, essentially, is lower your “minimum payment” each month. Granted, with a longer term, you will more than likely have a higher interest rate. What you must do, on a case-by-case basis, is decide if the flexibility of lower payments is worth that higher rate.