It all depends on the loan product and the lender.
Some interest rate lock-in periods are as short as seven days, but most reputable lenders provide for a range from seven to at least 60 days.
Extended rate-locks are available with lock-in periods as long as 270 days. However, these extended locks may require extra discount points or a slightly higher interest rate.
A loan officer can provide detailed information based on your requirements.