Mandarin is the most widespread Chinese language. It belongs to the Sino-Tibetan family, further sub-categorized in the Chinese branch. Mandarin, also called Modern Standard Chinese or Mainland Standard Mandarin, is a single Mandarin dialect (among other Mandarin dialects), and is in fact a language fabricated based on the pronunciation of the Beijing dialect, using vocabulary from other Mandarin dialects, and grammar taken from written vernacular Chinese (which itself is based on written forms of different dialects spoken throughout China). Mainland Standard Mandarin (MSM) is only recently showing evidence of acquisition of native speakers; however, it is often learned as a second language in China, where it is used in schools and in government. Mandarin varieties are also spoken widely in Taiwan and Singapore. It’s important to keep in mind that what we call “Mandarin” is actually one variety in a group of related varieties; on this page, “Mandarin” and “Mainland Standard Mandarin” are used to mean the same thing.
Mainland Standard Mandarin (“common speech” or pǔtōnghuà [普通话] in Mainland China) is generally taught using the concepts of “initials” and “finals”: MSM has 21 initials and 40 finals. This framework aside, we can say that MSM has 24 consonant phonemes and between 7 and 13 vowel phonemes.
The problem underlying the debate over the number of phonemes found in the language is the complementarity found among multiple sounds: one sound may be found only in some contexts, and another found only in other contexts. This makes it difficult to pin down the exact number, and, in my eyes, has given rise to the teaching of initials and finals.