The gravitational acceleration of an object near the Earth's surface is called the acceleration due to gravity. It can be measured by conducting simple experiments on Earth. However, such an experiment is impossible to conduct on the surface of other planets.
Astronomical observations are thus used to measure the acceleration due to gravity on other planets. This can be determined by observing the effect of a planet's gravity on objects close to it. The crucial factor that helps in this calculation is that the acceleration is affected by the planet's gravitation but is independent of the object's mass.
Astronomical observations focus on the trajectory of a planet's satellite, more specifically the distance between the planet and its satellite. Combining the results with Newton's law of gravitation and Newton's laws of motion helps determine the planet's acceleration due to gravity.
The planet's mass can then be calculated if the acceleration due to gravity is determined, provided that the planet's radius is known from independent astronomical observations. The method relies on making multiple observations because there are no direct means to measure the mass of distant planets.