2 years. In the event of revocation or expiration of the passport, ESTA is repealed and no longer valid. If the ESTA expires while you are in the United States, you do not need to apply for a new one because it must be valid only when you enter the United States.
Exemple 1: Marcel
Marcel got his confirmation document 9 months ago when he went with his family to Orlando for the birthday of his daughter Olivia. In two months, Marcel will go to Denver Colorado for 5 days, for a business meeting. As the ESTA is valid for 2 years (if the passport associated with it is the same), Marcel can use the same ESTA to go to Denver.
Exemple 2: Valérie
In January of this year Valerie, thanks to the ESTA was able to attend an English course in New York (less than 21 hours a week, otherwise it would have needed to obtain a student visa). She remained in the United States for a total of 88 days.
In June, thanks to her travel authorization Valerie is back in New York to participate in the wedding of a close friend, whom she experienced precisely during the course followed in January. She spent a few more days in New York.
In total Valerie spent 109 days in the United States during the calendar year.
Today, Valerie is planning a car trip to the United States, which will last another 3 months. But this time Valerie must obtain a B-type visa because with this new trip she will pass the 180-day limit that ESTA authorizes (its total being 197 days during the year – 88 + 109).
ESTA allows you multiple entries in the US, but no stay can exceed 90 days, and a maximum of 180 days during the calendar year.