Learning is an individual process. How much time you need to attain a certain level depends on various and individual factors: your commitment, your time input, and your taking advantage of additional practice resources.
Should you already have studied one or more languages, you may learn German faster. It makes a big difference if you participate in a language course in your home country or in Germany, where you will be exposed to the German language outside the classroom.
Also of relevance is the intensity of the instruction (intensive vs. evening courses, for example). Please consult the testing location of your choice and request a personal consultation.