If you want to stay longer than your visa allows, you must get a residence permit. If you don't have your own address and are staying with a friend, you can use the residence of a friend as your residence.
Your host will need to create a taahhutname (literally, "an undertaking"), at a noter (notary) office. The taahhutname will be a guarantee, by your host, to be responsible for any debts, fees or fines you incur while staying with them, and ensure you leave Turkey before your residence permit expires. If your host is married, his or her spouse will also have to sign the taahhutname.
Your host (and spouse, if applicable), must go with you to the noter. Take your and their identification, and their tapu (property title deed) or a rental contract with their name on it. Once the taahhutname is created, if any of the involved parties don't speak Turkish, an official translator will read it out loud to make sure everyone understands it. Then the parties will sign it.
You can then include the taahhutname with your residence permit application as proof of your address. The DGMM may require that the person you are staying with also attend your appointment. So have one of them go with you, or make sure they are immediately available on the day of your appointment.
Turkey's Foreigner Communications Center
The DGMM has a number you can call to speak to an immigration specialist. Call 157 from any telephone within Turkey. The call will be free. From outside of Turkey, call +90 312 157 1122. Long-distance charges will apply.
Proving You Have an Address
Residence Permits Forums: If you have any questions or comments about the residence permit application process, please ask them there.
The Four Basic Steps of Applying for or Extending Your Residence Permit
Turkey Residence Permit Law (PDF): The Law on Foreigners and International Protection, Dated April, 2014. In English, this is the Turkish law which governs residence permits.