The moment you are comfortable with your monthly mortgage payment and/or terms.
In our opinion, waiting and trying to time the market can create a lot of anxiety and unless we have a crystal ball, no one really knows what interest rates are going to do tomorrow or the next day, not even the Fed Reserve can tell us with certainty. So, with this in mind, my recommend locking your interest rate the moment you are comfortable with your payment and/or terms and then if rates lower during the process, we can always explore options to lower your previously locked rate to that days terms.
This allows you to get the best of both worlds,
1) protection from interest rates increasing and
2) the ability to reduce your interest rates should they drop during your loan process.