A rate "lock" or "commitment" is a promise from the lender to lock in a particular interest rate and a specific number of points for you for a certain period of time while your application is processed. This ensures that your interest rate can't get higher during the application process.
While there are various lengths of rate lock periods (from 15 to 60 days), the longer spans are usually more expensive. You can get a longer period for your lock, but in doing so, will most likely have a higher interest rate than you would have with a shorter period
In addition to choosing the shorter rate lock period, there are several ways you can score the best rate. The larger the down payment, the lower the interest rate will be, because you will be starting with more equity. You can pay points to bring down your rate for the term of the loan, meaning you pay more up front. One strategy that is a good option for many people is to pay points to reduce the interest rate over the life of the loan. You pay more up front, but you'll come out ahead in the end.