A rate "lock" or "commitment" is a promise from the lender to hold a specific interest rate and a particular number of points for you for a certain period during your application process. This prevents you from working through your whole application process and learning at the end that your interest rate has gone up.
Although there may be a choice of rate lock periods (from 15 to 60 days), the longer spans are typically more expensive. You can get a longer period for your lock, but in doing so, will most likely have a higher rate than you would with a shorter period
There are other ways to get a better rate, in addition to opting for a shorter rate lock period. The bigger the down payment, the better your interest rate will be, as you will have more equity from the start. You can pay points to reduce your rate for the loan term, meaning you pay more initially. For a lot of people, this makes financial sense..
Do you have a question regarding a mortgage program?