I’m not sure there’s a cut-and-dry answer for this. Do it sometime when it is safe, not crossing solid white lines, and not too far in advance that you are blatantly driving in the bus lane for miles and miles and receive a ticket.
Usually I would aim for about 3/4 – 1/2 block. If you wait too long and get too close to the intersection, other vehicles may be in the space, so consider the vehicle behind you and remember to signal early.
After the last lane-way, might be a good rough guideline:
Perhaps, “After the last parked car,” can be a guideline.
If anyone has a better answer, let me know.