The orbits of the planets around the Sun are ellipses, with the Sun at one focus

It should be noted that nearly all of the planets have eccentricities which are small, only a few percent, and their orbits are close to being circular. The eccentricity in the picture above has been exagerated for effect.
In its orbit, a planet sweeps out equal areas in equal times
The three shaded
sections all have the same area
The physical reality behind this law is the observation that the planets move relatively quickly when they are in that part of the orbit which lies close to the Sun, and more slowly when they are further away from the Sun. The orbits of most of the planets are nearly circular, and the distance to the Sun and the speed of the planet in its orbit only changes by a few percent. It is however a big effect for the comets, which fly by the Sun in only a few months, but spend many years in that part of their orbit which is away from the Sun.
The ratio of the cube of the distance of a planet from the Sun and the square of the orbital period is the same for all of the planets.
Although it predates it historically, the third law can be derived from Newton's Universal Law of Gravity applied to the motion of any object orbiting around a central mass, in this case the Sun. If we use A.U. for the units of distance and (Earth) years for the units of time, then both these quantities are equal to 1 by definition. For the Earth r^3/T^2 must equal one, and so by the third law it is 1 for all the other planets also. We can therefore write
r3 = T2
for all the planets.
Suppose you look up in a book that Saturn is 9 A.U. from the Sun. Can you calculate its orbital period? From the third law we know that T2 = r3. Substituting r=9, we get
T2 = 93 = 729
from which T = 27 (Earth) years.
Another example
If you could find a new planet which orbits the Sun in 40 years, how far away from the Sun must it be? We can now write
r3 = T2 = 402 = 1,600
and so r = 11.7 A.U.