The effect of gravity lessens with distance. For example, the farther a body is from Earth the less effect Earth's gravity has on it. By the way, every body in the universe has a gravitational effect on every other body. Let's say an apple falls from a tree. The Earth is, of course, exerting a gravitational pull on the apple. However, the apple is also exerting a gravitational pull on the Earth. Of course, the difference in mass between apple and Earth is enormous. Thus, the apple comes toward the Earth and not the other way around.