According to Kepler’s first law, a planet’s orbit is an ellipse.
More precisely, the planet follows an elliptical path with the Sun at one focus, rather than at the geometric center. An ellipse can look nearly circular when its eccentricity is small, which is why many planetary orbits appear circular in diagrams and ordinary observations.
Johannes Kepler published the first two laws in 1609 in Astronomia nova and later presented all three laws in works published through 1621. He derived them from the exceptionally precise observations of Tycho Brahe, replacing the older assumption that heavenly motion had to use perfect circles and epicycles.
The law does not mean that every orbit in space is an ellipse. Objects can follow parabolic or hyperbolic escape paths, and real planetary orbits are also perturbed by the gravity of other bodies. In the ideal two-body model, however, a bound planet’s orbit is elliptical. Earth’s orbit has a small eccentricity of about 0.0167, so it is close to a circle.