Probably the easiest way to get some free food in Turkey is to visit local bazaar places after the end of the market. These are common everywhere in the country. Vendors sell fruits and vegetables during the day (at least one day a week), and at night/evening they usually throw away what they could not sell. Simply ask locals for the places of bazaar.
A lot of supermarkets put their old vegetables and fruits outside in a separate box, so you only need to go and take whatever you like. If not, you can also ask the staff, if they have some old fruits/vegetables to give. They do it quiet often.
In the big cities it is possible to table dive in restaurants. Also you can ask in the restaurants in the evenings if they have leftovers. Very good are the Lokantas, which are cheap restaurants that offer various dishes and serve them plate-based. Some restaurants will give you their leftovers, but also a lot of times they will offer you (new) food for free. If you don't care getting new food, your main purpose is to get it for free and you have time you can also offer the restaurants to work there for an hour and in return they give you some food. In most of the cases they won't let you work but will feed you either ways.
In bakeries (fırın) it is possible to get old bread or simits in the evenings or in the mornings if you ask for it. They will also offer you new bread for free.
Besides dumpster-diving, people place their trash out on the streets in bags, it is picked up at night. In the neighbourhoods you can walk through the streets and you will find besides food (especially in front of supermarkets) clothes and more nonfood items.
A little guide for asking for food:
People usually don't speak enough English to understand exactly what you want. Try with turkish words, even if you don't conjugate the verbs, people will understand more often. Explain your situation and be honest!
- iyilik - a favor
- yardım etmek - help
- eski yemek/ekmek - old food/bread
- eski yemek/ekmek var mı? - is there old food/bread?
- bayat - another expression for old food
- dünki yemek - yesterdays food
- meyve - fruit(s)
- sebze - vegetable(s)
- ekmek - bread
- seyahat etmek - to travel
- lütfen - please
- Teşekkürler! - thank you!
Personal experience: "Pardon, atılacak yemek var mı ?" for food and "Pardon, eski ekmek var mı ?" for bread worked best for me. Ask turkish friends about the pronunciation.