Unless revoked, Your ESTA authorization is generally valid for multiple trips over a period of two years (starting the date that you are approved) or until your passport expires, whichever comes first. This means that as long as you received an ESTA authorization to travel, you do not have to reapply during the validity period.
If your ESTA expires while in the U.S. it will not affect your departure.
Receiving ESTA authorization does not mean you may stay in the U.S. for two years. It only allows you to travel to the U.S. under the terms of the Visa Waiver Program (VWP), which only allows you to stay in the U.S. for 90 days or less. If you plan to stay for longer than 90 days, you must obtain a visa at the nearest U.S. Embassy or Consulate.