Your lender will send you an offer before maturity, and if it is a federally regulated institution it must provide a renewal statement at least 21 days before the end of the term; that document must state that the rate offered will not rise before the renewal date. That is your minimum protection, not your best outcome: the automatic offer is built for people who sign without comparing. Start comparing some 120 days ahead — that is the window in which most lenders can hold a rate for you, though that is market practice rather than a legal obligation.
The real difference between staying and leaving is not money, it is qualification: renewing with the same lender does not reopen your file, and switching lenders does, stress test included. If your situation has worsened since the first mortgage, staying may be the only route open; if it has improved, competition works for you. Knowing which of the two cases is yours is what is worth being clear about before you start.