Whether you need a visa for entry to Germany or not, depends on your nationality. As a rule, most non-EU foreigners are required to obtain a visa for stays of more than three months or stays leading to gainful employment. Exemptions apply to EU nationals and EEA nationals from Iceland, Liechtenstein or Norway as well as to Swiss nationals.
Please contact the German diplomatic representation in your home country (i.e. embassy, consulate) as early as possible (at least two months in advance of your departure) to find out if you need a visa for your studies in Germany. You can also find information on the website of the Federal Foreign Office of Germany.