There is no simple answer to this question as it depends on a number of key factors, namely the aspects or criteria of your mortgage and investments. By illustrating these factors you'll be better armed to make this choice. The question boils down to: Which of these - the investment or the mortgage repayment - takes greater advantage of the money you received?
A mortgage payment contains two aspects - the repayment of principal and the interest expense - that is charged by the financial institution holding your mortgage. The principal repayment goes towards the purchase price of the home and the interest is the expense charged for borrowing the money.
Let's assume you received a lump-sum payment of $50,000, and you have 10 years left on your mortgage. If you were to pay for it today it'd cost you $50,000 in principal. If you were to continue to make monthly payments until the end of the mortgage, you'd end up paying an extra $15,000 in interest payments (the amount of interest you pay is dependent on the mortgage rate). Using that $50,000 to pay it off today brings a savings of $15,000 in future interest expenses.
The other side of the question is the investment. There are several factors to weigh when evaluating an investment. The first is its expected return - is it so attractive, with high expectations of growth, or is it in the more conservative mutual funds or bonds category? The more attractive the investment, the more likely you'll invest the money.
If, for example, the investment is expected to earn 10% each year for the next 10 years - the same length as your mortgage - the $50,000 would turn into nearly $130,000. In this case, you'd want to put the money into the investment and make regular payments on the mortgage since the $15,000 you'd pay in interest payments would still leave you with $115,000 in profit.
However, a 10% return is not a very easy goal to achieve. At 5%, your $50,000 investment would turn into a little over $81,000 by the end of the 10 years. The higher the investment return, the more likely you are to invest than paying down the mortgage - but make note that these returns are never guaranteed.
What is important to your decision making is knowing your risk tolerance - the more risk you take, the higher your expected return. The stock market does provide exciting returns but it can also devastate like it did for many investors in 2000 when the dotcom bubble burst. If you can't handle the risk of losing a large percentage of your portfolio while still having to pay off your mortgage, it may be safer for you to just pay off the mortgage and save the $15,000.