The gravitational force between objects is dependent on their mass and distance from one another

That is correct. According to Newton's law of universal gravitation, the gravitational force between two objects is directly proportional to the product of their masses and inversely proportional to the square of the distance between their centers of mass. The formula can be stated as:

F = G * (m1 * m2 / r^2)

where F is the gravitational force, G is the gravitational constant, m1 and m2 are the masses of the objects, and r is the distance between their centers of mass.