That depends on when you want to buy your home. There's no reason to wait to lock in your mortgage rate unless you have an indication that you'll qualify for a lower rate later on. Since mortgage rates are at historical lows right now, it might be a good idea to lock in your rate so you can qualify for the best terms.
The best time to lock in your mortgage rate will always be when interest rates are at their lowest. This is always hard to predict – even for financial experts – and interest rates may even decrease during your lock period.
However, the latest trends suggest that, due to the waning of the COVID-19 pandemic and the rise in inflation, mortgage rates are going to start increasing by the end of 2022. Lock your mortgage rate now and it could save you some money.