To apply for an English-language degree programme, proficiency in English is enough and not necessarily to be in German.
On the other hand, to apply for degree programmes taught in German, it is mandatory you will need better proficiency in German.
While you apply to a degree programme at a German university, you will have to submit certificates confirming your German proficiency (see: German tests for the university). Of course, this shouldn’t be the only reason to learn German. Even after you’ve passed a language examination or achieved the necessary test results, you should continue working to improve your German.
That is the reason it is better to learn as much German as possible before landing there.
German universities offer language courses, for which students often have to pay an extra course fee. In addition to language courses during the semester, some universities offer intensive summer courses. Many institutions and language schools also offer German courses. These include the Goethe Institutes and the adult education centres, as well as many other, mainly privately funded schools.