A rate "lock" or "commitment" is a promise from the lender to set a particular interest rate and a specific number of points for you for a certain period of time while your application is processed. This protects you from working through your entire application process and learning at the end that the interest rate has gone up.
While there might be a choice 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 choosing this option, will probably have a higher interest rate than you would with a shorter span of time
In addition to opting for a shorter rate lock period, there are other ways you are able to attain the best rate. A bigger down payment will give you a reduced interest rate, since you'll have more equity at the start. You could opt to pay points to improve your interest rate over the term of the loan, meaning you pay more up front. One strategy that makes financial sense for some is to pay points to bring the rate down over the life of the loan. You'll pay more initially, but you will come out ahead, especially if you keep the loan for a long time.
Do you have a question regarding a mortgage program?