There are two types of rocks that are used to measure the age of the Earth: meteorites and earth-based ores.
Meteorites are used because it is believed that the Earth formed at the same time as the rest of the Solar System. Using radiometric dating techniques, the ages of well-dated meteorites, as well as lunar samples (returned from the Apollo missions) fall between 4.4-4.6 billion years. The seventy best-dated meteorites have been tested using 5 different radiometric techniques.
The oldest surface rocks on Earth have been discovered in Greenland. These have been dated to 3.7-3.8 billion years. Rocks in South Africa and Western Australia have ages of 3.5-3.6 billion years. We understand that the Earth's surface was originally very volatile - volcanoes and disrupted oceans, as well as the plate tectonics we see today. Therefore it makes sense that the oldest rocks we can find on the surface of the Earth are a little younger then the formation of the planet itself.
Radiometric dating techniques have been used to date both types of rock. The technique uses the half-life and parent-daughter chains of certain radio-active metals (for example, the ratio of uranium-235 to lead-207) to investigate the age of the rock.