Technically, never. As far as we are aware, the reach of gravity is infinite, so no matter how far away you are from something, it’s still attracting you to it ever so slightly. So if the Earth were the only object in the entire universe, no matter how far away you were you would be attracted towards it.
However, there are other things in the universe. This means the question you’re asking is how far away from the Earth do you need to be before you’re attracted towards something else instead?
The answer to this is important enough that we’ve given it its own name. Lagrangian points are points in space where the gravitational attraction between the Earth and the Sun are exactly balanced. If we put you at one of these points, you wouldn’t move towards either the Earth or the Sun, but would stay right where you were! If we put you slightly towards the Sun, you’d start moving towards it, and if we put you slightly towards the earth, you’d head home instead.
Langrangian points are actually very useful because if we put a spacecraft there, they don’t move! It’s a good place to put scientific instruments for measurements, telescopes and so on.
So where are they? L1, between us and the sun, is about 1.5 million kilometres from Earth. That’s about 1% of the distance to the Sun, or 4.8% of the way to Venus.