Johannes Kepler (1571-1630), drawing on data from the observations of Tycho Brahe (1546-1601), worked out the mathematical relationships governing the orbits of the solar system. Years later, Sir Isaac Newton's theory of gravity put these laws into perspective, showing them as natural consequences of the gravitational attraction of the sun acting on each of the planets. Kepler's Third Law states that a planet's period of revolution around the sun (its year) is related to its mean distance from the sun: The square of the year is proportional to the cube of the distance.
Find the average distance in Astronomical Units (AU) from the planet to the sun. One AU is the distance from the earth to the sun, approximately 93 million miles. The distance is an average because Kepler's First Law states that planetary orbits are ellipses, not necessarily circles, so the distance usually varies somewhat over the period of the planet's orbit.
Cube the average distance, or raise it to the power of three. For example, a planet exactly twice the distance from earth to the sun has a mean distance of 2.00, which becomes 8.00 when cubed.
Take the square root of the cube of the average distance. This is the orbital period of the planet in earth years. In the example, the square root of 8.00 is about 2.83, so a planet orbiting at 2.00 AU from the sun takes 2.83 years to complete an orbit.
These calculations are based on the mass of the sun and only work directly in this solar system, but the basic relationship holds in any orbital situation: The square of the period equals the cube of the distance multiplied by a constant that depends on the mass of the central body.