The Duration of Aftershocks
I can show you some aftershocks right now: just look at the map of recent earthquakes for the San Simeon area of California. In any given week, there are aftershocks there from the 2003 San Simeon earthquake. And east of Barstow you can still see a trickle of aftershocks from the October 1999 Hector Mine earthquake.
Indeed, some scientists argue that aftershocks may last for centuries in places, like continental interiors, where plate motions that build up stresses in the crust are very slow. This makes intuitive sense, but careful studies using long historical catalogs will need to be done.
The Trouble with Aftershocks
Two things about aftershocks make them troublesome. First, they aren't restricted to the spot where the main shock occurred, but can strike tens of kilometers away—and, say, if a magnitude 7 quake was centered out beyond the suburbs but one of its magnitude 5 aftershocks happened right underneath City Hall, the littler one might be the worse of the two. This was the case with the Christchurch, New Zealand earthquake of September 2010 and its large aftershock five months later.
Second, aftershocks don't necessarily get smaller as time passes. They get fewer, but sizable ones can happen long after most of the little ones have ended. In Southern California, this phenomenon aroused so much concern after the Northridge quake of 17 January 1994 that Hough wrote an op-ed piece for the Los Angeles Times on the subject three full years later.
Scientific Uses of Aftershocks
Aftershocks are scientifically interesting because they are good ways to map the underground fault zone that ruptured in the main shock. (Here's how they look for the cases of Northridge.) In the case of the 28 September 2004 Parkfield quake, you can see that the first hour of aftershocks alone outlines the ruptured zone quite well.
Aftershocks are also interesting because they're fairly well behaved—meaning that they have a detectable pattern, unlike all other quakes. The definition that scientists use for an aftershock is any seismic event occurring within one rupture-zone length of a main shock and within the time it takes for seismicity to fall off to what it was before the main shock.
This body of quakes fits three mathematical rules, more or less. The first is the Gutenberg-Richter relation, which says that as you go down one magnitude unit in size, aftershocks increase in number by about ten times. The second is called Bath's law, which says that the largest aftershock is, on average, 1.2 magnitude units smaller than the main shock. And finally, Omori's law states that aftershock frequency decreases by roughly the reciprocal of time after the main shock.
These numbers differ a bit in different active regions depending on their geology, but they're close enough for government work as the saying goes. So seismologists can advise the authorities immediately after a large earthquake that a certain area can expect X probabilities of aftershocks of Y sizes for Z period of time. The U.S. Geological Survey's STEP project produces a daily map of California with the current risk of strong aftershocks for the next 24 hours. That's as good a forecast as we can make, and probably the best possible given that earthquakes are inherently unpredictable.
Aftershocks in the Quiet Zones
Still to be determined is how much Omori's law varies beyond active tectonic settings. Large earthquakes are rare away from plate boundary zones, but a 2000 paper in Seismological Research Letters by John Ebel showed that aftershocks of these intra-plate earthquakes could last for several centuries. One of those was the 1663 Charlevoix, Quebec, earthquake; another was the 1356 earthquake in Basel, Switzerland. In the American Midwest, those would be prehistoric events.
In 2009 Seth Stein and Mian Liu argued in Nature that these quiet settings seem to slow everything down, with stress increasing slowly and aftershock sequences lasting longer. They also noted that where the historical record is short, such as in the United States, it may be a mistake to judge the degree of earthquake hazard from events that are actually aftershocks rather than background seismicity.
This knowledge may not help you cope with your nerves if you live in an aftershock zone. But it does give you some guidelines as to how bad things will be. And more concretely, it can help engineers judge how probable it is that your new building will be hit by significant aftershocks over the next few years and plan accordingly.
PS: Susan Hough and her colleague Lucy Jones wrote an article on this subject for Eos, the house journal for the American Geophysical Union, in November 1997. The U.S. Geological Survey scientists closed by saying that "we would like to propose that the phrase 'just an aftershock' be hereafter banned from the English language." Tell your neighbors.