A very strong case can be made for: immediately. If the Democratic National Committee is going to open up the primary to other candidates, the sooner the better.
Of course, a Democratic president dropping out of the race for reelection is not without precedent, or irony in this case.
12ft | When is the optimal time for Biden to drop out of the race? | The Hill