The expression for the acceleration due to gravity can be given as,
Here, g is the acceleration due to gravity, G is the gravitational constant, M is the mass of planet and R is the distance from the center of planet.
Therefore, the acceleration due to gravity depends upon the distance from center of planet and the mass of planet.