The U.S. State Department's website lists criteria which must be met for by-mail renewals. If you do not meet all these criteria, you will need to renew your passport in person.
If you are renewing by mail, you must complete Form DS82, which is available online at the State Department's website. You can also pick it up from a local passport service agency or acceptance facility.
In addition to Form DS82, you must send in your most recent passport, two passport photos and a $75 renewal fee to the address listed on the online form.
Don't wait until the last minute to renew an expiring passport; the State Department says it takes four to six weeks to process a renewal. Expedited service will take only two to three weeks, but it will cost you an extra $60.
Theoretically, your passport is good up through the expiration date. However, some countries require that your passport be valid for a minimum of six months after you depart that country, so you may need to renew early.