If you apply for a German university and accepted; you need to get German student visa. It is really important to apply for a visa as soon as possible. Because visa process can take several months. Do not delay it.
Some students have to get German student visa to stay in here, some of them not. Situation changes according to nationality of students. EU students that apply German university do not need to get student visa to entering in the country. US, Canada, Australia, New Zealand, Israel, Japan, South Korea and Switzerland citizens do not have to get German student visa too. But these students should get residence permit in two weeks when they enter Germany. Students that come from other countries have to get German student visa.
How to Apply for German Student Visa?
Process takes long time; so students should apply for a visa three months before they move Germany. For this, you need to go German embassy or consulate for applications. Your acceptance documents from university are necessary. A valid passport, sufficient funds that is enough for first year in Germany and new health check are necessary documents. Some embassies are required criminal record, it depends. If you will stay in Germany more than three months it is better to apply for Schengen Visa instead of student visa. Students can also work in Germany with student visa. For full time jobs they can only work for 90 days, and 180 days for half day jobs. After you get student visa; you need to get resident permit after your arrival.