For small swings, a pendulum’s period depends only on its length and the local strength of gravity. The mass of the bob does not appear, and neither does the amplitude.
This independence from amplitude is called isochronism, and it is what made the pendulum the basis of accurate timekeeping for nearly three hundred years. A pendulum clock keeps time even as the swing decays.
The small-angle approximation
The formula comes from replacing sin θ with θ, which is accurate to better than 0.1% below about 5°. Beyond that the real period is longer, and the error grows with the square of the amplitude — roughly 0.2% at 10°, 1.7% at 30°, and 18% at 90°. The calculator shows the corrected value using the standard series expansion.
Length dominates, but as a square root
To double the period you need four times the length. A pendulum beating exactly one second per swing is about 0.994 m long, which is why grandfather clocks are the height they are.
Measuring g with a piece of string
Rearranged, g = 4π²L / T². Time fifty swings rather than one and divide, so that your reaction-time error is spread across all of them. Done carefully this gives g to within a fraction of a percent, and it remains one of the cleanest experiments in an introductory lab.