There really isn't a best "time."
Only pupate the largest worms. My four year old daughter calls them the "big and juicy" ones. The ones I pupate all tend to be well over 2 inches long, usually 2.25 inches or bigger.
It takes a lot of energy to get them through the pupation process, so they need the size to make it. Using smaller ones will result in a higher die-off rate.
If they are already in the right size range, just keep them well fed for a week or so to get them past any possible stress from shipping.