I am traveling from the United States and my layover in Istanbul is 24hrs (Turkish Airlines). Do I need a visa to leave the airport? If so how much is it?
Yes, you need a visa to leave the airport.
According to Do I need a Turkey transit visa for a layover? you don't need a visa when the transit is just 24 hours, but that is if you stay at the airport the whole time.
If you want to leave then you have to get a visa.
The Electronic Visa (e-Visa) Application System was launched on 17 April 2013 by the Ministry of Foreign Affairs of the Republic of Turkey. This system allows visitors travelling to Turkey to easily obtain their e-Visas online, in approximately three minutes. The e-Visa cost 20 USD.