It depends on how you entered the country in the first place. EU citizens don't have restrictions on their movement to or from Germany. Someone on a student visa, however, will have to leave once his residency expires. someone with a job seeker visa will have to leave if he can't find a job in a set amount of time.