A rate "lock" or "commitment" is a lender's promise to freeze a particular interest rate and a specific number of points for you for a certain period while your application is processed. This ensures that your interest rate cannot rise during the application process.
While there are various lengths of rate lock periods (from 15 to 60 days), the extended spans are usually more expensive. You can get a longer period for your lock, but in doing so, will likely have a higher rate than you would with a shorter span of time
There are more ways to get a better rate, besides agreeing to a shorter rate lock period. A bigger down payment will get you a better interest rate, because you'll have a good amount of equity from the beginning. You might choose to pay points to lower your rate for the loan term, meaning you pay more initially. One strategy that is a good option for some is to pay points to bring the rate down over the life of the loan. You are paying more up front, but you'll save money in the long run.