Do I need a new ESTA application if my name has changed due to marriage, divorce, or another legal proceeding?

If your name has changed but you have not yet submitted your application, then you should make your changes and submit it. Bear in mind that although the form can be completed in minutes and the process of obtaining authorisation is quick, the U.S. authorities recommend completing the form at least 72 hours prior to your flight, or at the time of booking. Make sure all information is correct before submitting to ensure things run smoothly.
If you have already submitted your form, making alterations to your application depends on the type of information you wish to change. Information such as your destinations, city of embarkation, email address, phone number, flight details, the address where you will be staying in the United States, etc., can be changed at any time (by clicking on the “Update or Check Status button” on your ESTA form) because these have no effect on the decision of our registration. However, a changes to details such as in your last name, gender, country of residence, citizenship, or any other biographical information, or to any questions relating to your eligibility to enter the U.S. require you to prepare an entirely new ESTA form.
The new ESTA application should be filled out and submitted in 24 hours, and requires a repayment of the original fee. Once the new application is submitted, the previous application is automatically made void.

My old passport is still valid, do I need to get a new one to apply for ESTA?

No, you don’t. If your old passport is still within date and valid, you can still apply using that passport, even though it has your old name on it. However, you must make sure you bring any necessary documents with you that proves that you are the person that travel document is referring to, as well proof that the change occurred. This could include documents such as a marriage certificate, a civil union certificate, adoption papers, divorce papers or any other legally recognised documents that mandate the change of name.
Please note, that if you’re a British citizen you cannot apply for ESTA using a post-dated passport