The trajectory and distance a golf ball travels after being hit depends on a few different factors. These include the force of the swing, the air resistance felt by the ball, and the gravitational force on the ball. The force of the swing won't change by a large amount on the Moon or Earth, so we will focus on the other two factors.
- As things travel through our atmosphere they are constantly running into air molecules. These molecules slow down the object and we refer to this friction as "air resistance". On Earth this would cause a negative acceleration in whatever direction the ball is travelling in. It wouldn't necessarily fall faster due to this resistance alone, but it would not travel nearly as far. On the Moon, where the atmosphere is non-existent, there would be no such slow down. The golf ball would see no lateral deceleration due to air resistance and would keep flying along at the same speed as it did when it was struck.
- The gravity on Earth pulls on all things and causes them to accelerate downward at around 9.8 m/s^2. The gravity on the Moon is about half of ours, thus the gravity on the Moon would only accelerate things at about half the rate of what things would fall on the Earth. On Earth, this means that as the ball is flying it would begin to curve its trajectory downward towards the ground. The Moon will only be pulling half the rate, so the golf ball would begin to peak its upward motion and fall after a much longer flight.
These two factors combined would create very different trajectories. On Earth, we would see a normal flight of the golf ball with horizontal speed being lowered by air resistance and the ball falling to the ground at the normal gravitational rate. A Moon based golf swing would instead result in a flight path much farther than the Earth based swing, due to there being no air to slow the ball down and only half the gravity pulling on the ball.
This has been tested by US astronaut Alan Shepard who, while on the famous 1969 Lunar Landing mission, took a golf ball with him to try his swing. A physicist later did the calculations on his swing and found the ball would have traveled around 2.5 miles! Compared to the longest drive of all time (515 yards) it appears to be by far easier to hit a golf ball on the Moon than Earth as it will fly much much farther.