For a visa you need at least a German B1 language certificate.
For recognition, a B2 language certificate is required.
In some federal states the B2 language certificate is required even before the preparation for the knowledge exam begins and sometimes even before the deficit notice (Defizitbescheid) is issued.
Currently recognized language certificates are: Goethe, ÖSD, ECL (telc: only if it was taken in Germany).
Also, be aware of the fact that you will generally understand German easier in the north of Germany than in the south (dialects).