How Are Earthquake Magnitudes Measured?
The Richter Scale
Figure 1  Charles Richter studying a seismogram. 

The Moment Magnitude Scale
Unfortunately, many scales, such as the Richter scale, do not provide accurate estimates for large magnitude earthquakes. Today the moment magnitude scale, abbreviated M_{W}, is preferred because it works over a wider range of earthquake sizes and is applicable globally. The moment magnitude scale is based on the total moment release of the earthquake. Moment is a product of the distance a fault moved and the force required to move it. It is derived from modeling recordings of the earthquake at multiple stations. Moment magnitude estimates are about the same as Richter magnitudes for small to large earthquakes. But only the moment magnitude scale is capable of measuring M8 (read ‘magnitude 8’) and greater events accurately.
Magnitudes are based on a logarithmic scale (base
10). What this means is that for each whole number you go up on the magnitude
scale, the amplitude of the ground motion recorded by a seismograph goes up
ten times. Using this scale, a magnitude 5 earthquake would result in ten times
the level of ground shaking as a magnitude 4 earthquake (and 32 times as much
energy would be released). To give you an idea how these numbers can add up,
think of it in terms of the energy released by explosives: a magnitude 1 seismic
wave releases as much energy as blowing up 6 ounces of TNT. A magnitude 8 earthquake
releases as much energy as detonating 6 million tons of TNT. Pretty
impressive, huh? Fortunately, most of the earthquakes that occur each year
are magnitude 2.5 or less, too small to be felt by most people.
Magnitude scales can be used to desribe earthquakes so small that they are
expressed in negative numbers. The scale also has no upper limit, so it can
describe
earthquakes of unimaginable and (so far) unexperienced intensity, such as magnitude
10.0 and beyond.
Here's a table describing the magnitudes of earthquakes, their effects, and the estimated number of those earthquakes that occur each year.
The Mercalli Scale
Figure 2  Giuseppe Mercalli 
Another way to measure the strength of an earthquake is to use the Mercalli scale. Invented by Giuseppe Mercalli in 1902, this scale uses the observations of the people who experienced the earthquake to estimate its intensity.

Some things that affect the amount of damage that occurs are:
Different building designs hold up differently in an earthquake and the further you are from the earthquake, the less damage you'll usually see. Whether a building is built on solid rock or sand makes a big difference in how much damage it takes. Solid rock usually shakes less than sand, so a building built on top of solid rock shouldn't be as damaged as it might if it was sitting on a sandy lot.