How long is an ESTA valid?
Two years, or until your passport expires if that comes first. It covers many trips, each up to 90 days.
Two years from approval, or until the passport it was issued for expires, whichever comes first. During that period one authorization covers multiple trips to the United States, with each stay limited to 90 days. 8 CFR 217.5 sets the two-year period in the regulation and allows DHS to change it by notice, and CBP's FAQ repeats the rule.
What ties the validity to the passport
An ESTA is linked to the passport number you entered on the application. If that passport expires in ten months, the authorization ends then, even if two years have not passed. A new passport needs a new ESTA, which the FAQ on new passports explains. A passport that is renewed with the same number, which some countries do, is unusual, so check the number.
What ends an ESTA early
DHS can revoke an authorization at any time, and some events cancel it:
Changes in your answers. If information on the application becomes wrong, such as a new name, a change of citizenship, or a new answer to one of the eligibility questions, the ESTA should be updated or a new one filed. The site allows some updates, such as address and travel plan, and requires a new application for others.
A new arrest or a finding that affects eligibility. CBP can revoke.
A refusal of admission or an overstay. An overstay makes you ineligible for the program from then on.
An ESTA that is valid does not guarantee entry. CBP decides each admission.
Each stay is separate
The two years are the validity of the authorization. They are not the length of any stay. At each entry, CBP admits a Visa Waiver traveler for up to 90 days, and the time cannot be extended. The FAQ on extending a stay on ESTA covers that. A trip that starts the day before the authorization lapses and runs for 60 days is allowed, since the validity governs travel to the United States, not the stay.
A worked case
A traveler is approved on 5 April, with a passport that expires on 20 September of the next year. The two-year date would be 4 April, two years later. The passport date comes first, so the ESTA ends on 20 September of the next year. If the traveler flies on 1 September of that year, the authorization still works. After 20 September, a new passport and a new ESTA are needed.
What goes wrong
Expiry on the passport date. Travelers assume two years and find out at check-in.
A name change. After a marriage or a legal name change, the ESTA no longer matches the passport.
Unofficial sites. Many charge extra and promise things the program does not offer.
Fee. CBP sets the fee, listed on the official site.
Who this applies to
It applies to travelers eligible for the Visa Waiver Program. Visa holders use their visa, which has its own validity.