Any gravitational field gets smaller and smaller the further away you get.
In theory you could be infinitely far away and still be attracted to it if there were not other bodies that would get you first.
In the case of the moon, the Earth is nearby and there is a region of space where hte moons gravity is dominant over the Earth. this is called the moon's gravitational sphere of influence.
http://www.go.ednet.ns.ca/~larry/orbits/gravas st/gravasst.html
In the case of the moon I make it about 48,000 miles, any more than that and the Earth would get you.
Note I am ignoring the Sun's influence on this because of the problems involved in 3 body calculations.
A sim
ilar question is what speed you have to be going to escape the moon's gravity - this is 2.4 Km/s that is the escape velocity for the moon