I hold an American passport, living in Finland with a Finnish residence permit. I'm going to Ghana. I would like to stay overnight, which means I will leave the airport to go to a hotel. Do I need a visa?
You will require a visa of some form. Historically for a US citizen this would be an easy process, but as at today's date there are complicating factors in that Turkey has significantly reduced the number of visas being issues to US citizens.
IN GENERAL, the only way for a US citizen to obtain a visa to visit Turkey is to apply via a Turkish consulate. US citizens are NOT able to obtain e-visas at this point in time, and in general are not able to obtain visa-on-arrivals once they arrive in Turkey.
However there are a few exceptions.
In your case, you ARE able to obtain a visa-on-arrival by virtue of the fact that you have a residence permit from a country outside of the US (Finland) AND you will be arriving on a flight from outside of the US. On arrival in Turkey you will need to show your Finish residence permit, and provide proof that you arrived on a flight from somewhere other than the US (eg, boarding pass) and you will be able to obtain a visa which will cost you US$30.
There are a few other exceptions for some people who are related (by blood or marriage) to Turkish citizens, however I'm presuming these are not relevant for you.
Note that the rules around this have been changing every few weeks, so depending on when you're flying it's possible the above will not be correct. It's worth keeping an eye on the news around this, and even contacting the Turkish consulate to confirm the current requirements shortly before your trip.