Most societies have a creation myth which explains how and when the Earth was formed.
For European societies, in the Christian era, the Book of Genesis was taken as a literal description of the creation until the 19th century. Not only did this state that the Earth had been formed in a week, it implied that the accounts of human events in the Old Testament covered the whole of the Earth's history. Archbishop Ussher of Armagh, writing in the 17th century, calculated that the genealogies given in the books of the Old Testament gave the date of the Creation as 4004 BCE . This extremely short period gave little time for geological processes to have any effect, though Noah's Flood was taken literally and used to explain the existence of fossils of animals and plants now extinct. But as geologists studied rates of erosion and deposition, let alone contemplated the possibility of mountain building, it was clear that much longer timescales must be involved.