Objects with a greater amount of mass will exert a greater degree of gravitational pull, but as the distance between two objects increases, the gravitational force between them lessens. The significance of distance with regard to large masses, such as planets, plays an important role in the science of Astronomy.
hope this helps :)