Answer
If your Visa is in a passport that has expired or will expire within 6 months of the end of your U.S. visit, you will need to get a new passport. However, you do not need to apply for a new visa. Just bring both your NEW and passport with the valid visa to present to the CBP Officer when you arrive in the U.S.
*Note: Your ESTA is not a U.S. Visa. If you obtain a new passport, you are required to apply for a brand new ESTA. To re-apply visit esta.cbp.dhs.gov.
The U.S. has an agreement with certain countries exempting their citizens from the requirement that their passports be valid for up to six months past the end of their U.S. visit. (See page 19 of the Carrier Information Guide on cbp.gov).Citizens of the countries which are exempt the six-month rule need to have a passport valid for their intended period of stay.
Please contact the U.S. Embassy in your country of citizenship to determine if you are exempt from this requirement.