After passing a vehicle, it is safe to return to your driving lane when:

Before you return to your driving lane, be sure you are not dangerously close to the vehicle you have just passed. One way to do this is to look for the vehicle in your inside rearview mirror. When you can see both headlights in your rearview mirror, you may have enough room to return to your driving lane.
DMV Writen Test