A rate "lock" or "commitment" is a lender's promise to freeze a certain interest rate and a specific number of points for you for a certain period during your application process. This saves you from working through your whole application process and learning at the end that your interest rate has gotten higher.
Rate lock periods can be various lengths of time, between 15 to 60 days, with the longer spans typically costing more. You can get a longer period for your lock, but in choosing this option, will likely have a higher interest rate than you would have with a shorter rate lock period
In addition to going with a shorter rate lock period, there are more ways you can score the best rate. The bigger down payment you can pay, the better the interest rate will be, since you will have more equity from the beginning. You can pay points to bring down your rate over the loan term, meaning you pay more initially. One strategy that is a good option for many people is to pay points to bring the rate down over the term of the loan. You are paying more initially, but you will save money in the end.