In general
In general we can determine the mass of a planet (such as the earth) by watching the orbit of a moon or satellite around the planet - knowing T and r. This applies to the sun as well, since the earth (and other planets) orbit it.
We can determine the acceleration due to gravity (gplanet) on a planet’s surface by knowing the planet’s mass and radius.