Gravitational force is inversely proportional to the square of the distance between the masses. More the distance, less the gravitational force; less the distance, more is the gravitational force. This is how gravitational force between two objects is dependent on the distance.