You need different documents to get the permission to enter Germany. The most important one is the visa. You should apply for it way in advance, because the processing of your documents takes a while.
Depending on which country you are from and the purpose of your stay in Germany, you will need a visa for entering Germany. You can apply for it at the German embassy or consulate in your home country. You can find the addresses of the German embassy and the consulate in your home country at www.auswaertiges-amt.de