On the way to Turkey, since you will be traveling from a non-Schengen country (the US) and traveling to a non-Schengen country (Turkey) you will not need to pass through immigration (processing of people entering a country) at one of the European locations that is likely to be your transit-only airport.
You will also not go through customs (processing of your luggage) as you will not be entering your layover country. If you're on a single ticket start to finish, your luggage will be checked all the way through to Istanbul.
How long of a layover is needed is heavily dependent on which airport you transit through. Most airports will indicate this on their website. In addition to what the airport suggests, you may also wish to allow time for a pre-departure delay.
On your return, in most cases you will go through both immigration (people) and customs (luggage) in your first US arrival city, though there are exceptions. I would want more than 2 hours at larger airports for an international-inbound connection. I've certainly seen people miss their connections at SFO due to long immigration lines.
If you have Global Entry, that can make a big difference in your immigration time. The last time I arrived with Global Entry (Denver) there was no line at all.