To understand the age of the earth, you must first have an understanding of three scientific principles: plate tectonics, planetary body formation sequences and the concept of radiometric dating.
Our understanding of plate tectonics is relatively recent but comparatively thorough despite the youth of the science. Essentially, and in the simplest terms, the earth is comprised of layers, the uppermost solid layer being the "crust." This layer is fragmented into plates and these plates move, sometimes sliding against each other, sometimes crushing into one another and sometimes one is pushed under another. Each of these interactions has a geologic effect: the slow rise of mountains, such as the Andes and the Himalayas, earthquakes, and volcanoes. Relative to the age of the earth discussion, we must consider the last scenario, when one plate is pushed beneath another, what we call "subduction."
This is important because in this constant, and geologically slow process one plate is literally pushed under another, where the intense heat of the mantle (a layer beneath the crust) melts the crust back into molten magma, destroying the original crust. Because of this process, the original crustal material formed at the beginning of the initial cooling period may no longer exist. To date, rocks have been verified to be part of this original Earth surface. If that's the case, how can we use any rock to determine the age of the earth?
Planetary Body Formation
It's reasonable to assume (and scientifically defensible) that the nearby bodies of any system formed at relatively similar times, or in a sequence expanding outward. Thus, one can make the assertion that the moon formed at a similar time as Earth.
Since the moon is a simple body, having no plate tectonic movement or crustal recycling, rocks from the moon are very likely to be from near the time of their origin. Rocks from the moon have been brought back to Earth during lunar missions for analysis. Along with these, meteorites that have survived impact with the earth have also been analyzed and compared to lunar and Earth samples. These samples have been analyzed using various radioisotope aging methods, collectively called radiometric dating. But what exactly is that and how does it help us?
Everything we know of is made of simpler components, specifically atoms. Atoms are comprised of smaller components, protons, neutrons (except for naturally occurring hydrogen, which has no neutrons) and electrons. Collections of atoms with the same number of protons and neutrons are called elements (like carbon), collections of elements are called molecules (like water) and collections of molecules are called everything else, from people to rocks to plastics. Our interest is in elements that have atoms with differing numbers of protons and neutrons, called isotopes. Some of these isotopes are radioactive, and through periods of time decay into different configurations or energy states, and in some cases elements. The elements that do so over extremely large periods of time do so at a specific rate and allow us to mathematically work out how long they have been decaying. This rate of decay is called a half-life.
If we measure the half life and can tell that a particular isotope will take 10 billion years to completely decay, we can look at the current stage of decay and work backwards to when it started this process. And with some isotopes, we can do so with an accuracy to within a few percent.
The best determinations of the earth and the solar system as a whole come from the decay of Uranium-238 to Lead-206 (4.5 billion years) and Uranium-235 to Lead-207 (704 million years) - Source: usgs.gov, q.v.
Meteorites, moon rocks and microscopic zircons (which may have survived plate tectonic recycling) place the age of our planet and solar system between 4.53 and 4.58 billion years old. According to researchers, this correlates with the approximate age of our galaxy the Milky Way, determined through analysis of the stages of evolution of globular cluster stars to be between 11 and 13 billion years. Not coincidentally, this corresponds well to the approximate age of the universe as a whole, estimated to be between 10 and 15 billion years old.