Aristarchus of Samos left the first preserved heliocentric model of our solar system.
He also ordered the planets with their respective distances to the sun.
He lived between 310 and 230 BC.
Therefore it could have been known since the 3rd century BC that the earth moves around the sun.
It took until the 16th century AD for the heliocentric model to take hold, when Nicolaus Copernicus provided a mathematical model.