Local municipal authorities
If you are leaving Germany and moving abroad, you have to unregister from your local municipal authority.
Update: May 2018
The deadline for de-registration is different in each state in Germany (between one and two weeks). If you fail to de-register within that deadline, you risk being fined.
This is known as Einwohnermeldeamt. To do so, you have to fill out a form online, send a letter or go in to the office during opening hours without an appointment. Please check the particular conditions of your local municipal authority for the correct procedure.
You will get a written confirmation about your de-registration.
In order to cancel a contract with telephone and internet services before the end of the contract term, many operators require a confirmation of your de-registration issued by your local municipal authority.