Turkey recently changed its regulations regarding the length of time you can stay outside the country on a residence permit, commonly known as the 120 Day Rule.
If you hold a short term residence permit (STRP), then you are allowed to be outside Turkey for no more than 120 Days in a rolling 12 Month period or you will have your residence permit cancelled.
Long term residence permits are subject to cancellation after spending 12 months continuously outside Turkey
Family Residence permits are cancelled after spending 180 days outside Turkey in any rolling 12 Month period.
If you have your first residence permit then the 12 Months start from the date on your permit, if you have a renewed permit then you should calculate the 12 months from your next entry into Turkey.
If you have spent more than 120 Days outside Turkey in those preceding 12 Months then you must get an e-visa to cover your stay.
Upon re-entry to Turkey your permit will be cancelled and you will need another valid visa for entry.
IMPORTANT NOTE - [UPDATE 19/07/2015]:
As of the date of writing there are many reports of people coming back into Turkey on technically expired residence permits, even though the 120-day rule is in current law it seems like the enforcement is arbitrary and non-consistent and people certainly arent being made aware their permits are cancelled at the port of entry, only finding out later that the permit was cancelled.
Some rumours are that the law wont be fully enforced till 2016 or 2017, sadly this is a serious problem with no solution as there are no official statements but we are getting more and more reports and emails from people that have been fined for "illegal" stays in Turkey after entering on an RP when they have been outside Turkey for more than 120 days then when trying to renew or re-apply for a residence permit they are being fined for the "illegal" stay in Turkey between date of entry and date of application for new/renewed RP. The application seems arbitrary at the moment but due to increased numbers of fines its best to err on the side of caution.
Therefore if you have a valid Residence Permit but have been outside of Turkey for more than 120 days in the last 12 months (from your date of re-entry into Turkey) then you are advised to obtain an e-visa and use this to enter Turkey, NOT your Residence Permit.
::UPDATE:: There have been multiple reports of passport control not accepting an e-visa if you have a residence permit regardless of whether you have been outside of Turkey for 120 days or not so if you have been outside for over 120 days then its best to go straight to your nearest GOC office when in Turkey and explain the situation and see if your RP is registered as cancelled on their system (or you could try a new online applcation and the first page or two should tell you your current RP status). If you wait till renewal you may have a fine for the period your permit was "cancelled" till renewal date.
Then you can apply for your Residence Permit online as normal, please bear in mind that this will constitute a "break" in continuous permits if you are wanting to "save up" for a 8 years uninterrupted RP for LTRP application purposes.