At what depth do earthquakes occur?

Earthquakes occur in the crust or upper mantle, which ranges from the earth's surface to about 800 kilometers deep (about 500 miles).