Mortgages generally come in either 15-year or 30-year term lengths, meaning you have that amount of time to pay back the mortgage to the lender. The shorter the term length, the bigger your monthly payment.
Mortgage lenders typically do not charge prepayment penalties for mortgages issued in 2014 or after. If you are unsure if your mortgage lender charges prepayment penalties, call them and find out. You may need to refinance your mortgage first by going to another lender without those penalties if they do.