For "the" Moon:
First, you need to know how big the Earth is. This is easily doable, using the method by Eratosthenes - the shadow of a stick in Alexandria and Syene.
Then you can determine how heavy the Earth is. Given its size, and the acceleration at the surface, you determine its weight.
Then, how big the Moon is. Well, during a Moon eclipse, assuming the Sun is very very far away, the diameter of the Earth's shadow is equal to the diameter of the Earth. So just look at the size and shape of the Earth's shadow on the Moon (a fraction of a circle) during an eclipse; knowing the size of the Earth, it is easy to then determine the size of the Moon.
How far the Moon is? Once you know it's size, just measure the angular diameter, do some basic trigonometry, and you get the distance.
Or you could do it the other way round, observing the Moon from two different places on Earth, knowing the distance between the places, and the angles the Moon makes with the horizon in both places. Then you could determine the Moon-Earth distance via trigonometry.
How quickly do the Moon and Earth rotate around their common mass center? That's easy, just measure it by simple observation, just look at the sky and you'll figure it takes about 4 weeks.
At this point, you know how big are the Earth and the Moon, what is the distance between them, how heavy is the Earth, and how quickly they rotate around each other. The only unknown is Moon's mass, which is deduced via newtonian mechanics.
Having Moon's mass and its diameter, it is easy to determine the acceleration on its surface, again via Newton.
For other moons and planets:
It depends. The orbits of the planets were determined via many thousands of observations. Once you suppose the Sun is in the middle and everything else runs around it, then all those many observations could only fit elliptical orbits of certain size and shape (this is not easy to explain intuitively, there's a lot of math).
So, you know Venus' orbit, and Earth's. You do the math, and figure that at this moment, the distance between them is X. You look thought the telescope, and measure Venus' angular diameter to be 50 arcsec. Now do some basic trig, and you'll determine its diameter. Easy.
How heavy is Venus? Having no satellites, you can't tell. You need to wait for a comet to be deflected, or you need to send a space probe to orbit around it.
Or you could measure the tiny variations in Earth's orbit caused by Venus, and estimate Venus' mass that way. But it's not very precise.
Mars is easier, it has satellites already, so you can determine its mass. So are Jupiter, Saturn, etc.