What a lock is
A rate lock fixes your interest rate for a set window, usually 30, 45, or 60 days, while the loan closes. Without one, the rate floats with the market until shortly before closing. The commitment runs both ways: the lender honors the rate if the market rises, and you do not automatically get the benefit if it falls.
When to lock
The usual guidance is to lock once you are under contract and the payment at that rate works for your budget. Trying to time the bottom of a rate cycle with your own housing costs is speculation. If the payment works, the certainty is generally worth more than the possible improvement.
Float-downs and extensions
Some locks include a float-down: if rates fall by more than a stated threshold before closing, you get one opportunity to reset lower. It is not free. It is paid for with a fee or a slightly higher starting rate, so ask what the trigger and the cost are before you assume you have one.
Extensions are charged per day when a lock expires before closing. That is one more reason returning documents promptly has a direct cost consequence.
After you close
A lock is not permanent. If rates fall substantially after you buy, refinancing is how you capture the change, subject to the closing costs of the new loan. The break-even test is simple: divide the total cost of the refinance by the monthly saving to get the number of months you must stay to come out ahead.
You can run that break-even yourself at /mortgage-calculator/refinance/ whenever rates move.