A language is a system of communication (source). So surely German, Austrian, French and Bavarian are all languages. But which of those 4 are distinct languages?
The next question is: What is a dialect and what makes dialects distinct?
There's no cut-and-dry line. Languages differ between each individual, but if they can understand one another very well, we still say they speak "the same language" (even if you use "haters be like" and they don't, and you say caught like cot and they don't).
Sometimes languages differ in a consistent way among a certain geographic or political line, or community (e.g. Afro-Americans) etc. If these differences are pronounced enough that they have some trouble understanding one another, but can still mostly understand it, we call it a "dialect". If understanding is low or zero, we say it's "another language". That is, the most common criterion linguists use is mutual intelligibility. This is a fuzzy, subjective measure, prone to disagreements.
Oftentimes things are defined as "languages" or "dialects" out of nationalism, politics or tradition. So, for example, many varieties of Japanese and Chinese that their governments call "dialects" are considered to be "different languages" by scientists, due to being clearly unintelligible to standard speakers (so that linguistics books talk of "the Ryūkyūan language family" where the government says "the Ryūkyūan dialects"). On the other hand, I speak Portuguese and can mostly understand Spanish without ever studying it; perhaps Portuguese would be considered a "dialect" of Spanish, were it not for the fact that it's a different nation and they'd be pretty annoyed at the idea. This led to the oft-repeated quip that "a language is a dialect with an army and a navy".