There is NEVER a good time to take a loan on your 401(k). You're robbing your own retirement. Do that only in an emergency situation -- you've lost your job, you have a desperate need for money and you have no other alternative.
The only time I would take a loan from a 401K is for the down payment on a house or condo. When you take a loan from a 401K, you have to pay it back with interest and if you leave the company, you get taxed on the outstanding loan.
It is never a good time to take a loan on your 401(k). Not only do you lose on earnings growth when you withdraw money, but you have to pay yourself back with interest. It's always better to have a proper emergency fund.
You should only borrow from your 401K in the case of a dire emergency because you will pay steep taxes and penalties. It is best to only borrow from it when you need a quick cash advance know you have money coming in to pay yourself back in time to avoid additional fees and penalties.
i think the best time is only when it is a last resort. if you want to use the proceeds of the loan to pay off higher-interest loans, then it can be a good idea because it is an instant and certain money saver.