A rate lock guarantees that the interest rate, points, and lender credits on your mortgage won't change between application and closing, as long as you close within the lock period. Standard locks run 30, 45, or 60 days, with longer locks available for additional cost.
Locking protects you against rising rates while underwriting finishes. The trade-off is that if rates fall after you lock, you don't get the lower rate (unless your lender offers a one-time float-down option).
Lock periods can usually be extended if your closing is delayed, but each extension typically has a fee. Always communicate timeline changes to your lender early so you don't accidentally let the lock expire.