According to generally accepted scientific theory, the earth is some four and a half billion years old, give or take a few million. This is based on the estimated age of meteorites and moon rocks. The oldest rocks found so far on earth are zircon grains from Western Australia, dated at 4.1 to 4.2 billion years old. The next contender is rock almost four billion years old from the Northwest Territories of Canada. The age of rocks is determined by using a mass spectrometer to measure the decay ratio of different radioactive isotopes, on the assumption that the half-life of a given isotope is a constant.
How did our solar system begin? Scientist have run computer simulations based on the evidence they have, and the debate is still open. In one popular scenario, the sun formed in the middle of a cloud of dust and gases. Dust grains and rocks stuck together, and then attracted more debris with their gravitational field. These meteorite-sized chunks quickly grew into planetoids, which started bumping into each other, each time creating a ring of very hot debris. These violent giant impacts gradually decreased as the chunks were assembled into planets and their moons.
For 500 million years of so, the interior of Earth stayed solid. Then the decay of radioactive elements (primarily uranium, thorium and potassium) released energy which heated the earth up so much that it started to melt. The iron melted first, and sank towards the center, forcing up the melting silicates. Young earth was one giant volcanic eruption, perhaps aggravated by the aforementioned giant impacts from other celestial bodies crashing into the earth and sending molten debris into space. When earth finally cooled down, the iron at the center became the core, covered by a mantel of molten magma and a thin crust of solid rocks. Water rose through fissures from the interior of the planet, filling the depressions in the crust. Expelled gases formed the atmosphere, which gradually changed to what we have today. Atmospheric conditions eroded the rocks into new formations, and tiny pieces of rock became sand and ultimately soil as life evolved.
The origin of life continues to be one of the great scientific mysteries. Scientists have speculated about possible processes, but have not been able to demonstrate them in the lab. The earliest idea was the primordial soup theory, where the first living cells were spontaneously assembled in nutrient-rich liquid, but the outer space theory, where the ingredients of life arrived on meteors, continues to be investigated.
Trying to piece together what might have happened billions of years ago is a mind-boggling exercise with many controversies and pitfalls. Much of the scientific evidence is so complex that an ordinary person cannot decipher it for him or herself. The creationist "young earth" view that the earth is only a few thousand years ago, and was created by God more or less as we see it today, seems easier and more plausible in comparison. The debate continues fiercely, and is not likely to be resolved any time soon, unless the apocalyptic prophecies of an imminent end come true.
The earth today is still hot inside. A relatively fragile crust of shifting tectonic plates float on the mantle of magma. The plates build mountains when they collide and faults when they pull apart, punctuated by earthquakes, volcanoes, and other seismic disturbances. The continental drift theory, which is supported by animal distribution and fossil evidence, postulates that there was once a single continent which separated into the continents we know today, and continues to drift back and forth, too gradually for us to notice.
Science estimate that the earth will be capable of sustaining life for many more millions of years to come. Will mankind be part of that story, or only a blip on the greater story of earth and the solar system? That depends on our ability to evolve and adapt to changing conditions.
Sources and resources:
origin of earth
origin of earth and moon
Nova transcript: earth is born
The beginning graphic version
Young earth creationism