Chinese is a term used to describe a large group of languages used in China. The term itself does not technically describe any specific spoken form of the language, of which there are many, but does accurately describe the character-based writing system, which all of the spoken dialects share.
The spoken forms of the language, such as Fujianese and Cantonese are mutually unintelligible, but are still called dialects because the term conveys the idea of a unified China. If China were divided into smaller countries the dialects would be considered to be different languages.
While Chinese is a general term for a collection of languages, Mandarin has become the common spoken form of the language. Many Chinese will speak both the dialect they grew up with as well as Mandarin. When someone decides to learn Chinese they will usually learn Mandarin because it is the most widespread form of the language.
Many Chinese consider the written form to be the heart of the Chinese language, with the spoken dialects being mere aural manifestations. For this reason there has been no widespread use of any of the phonetic forms of the language, such as pinyin. The written language provides a common communications medium for all speakers of Chinese dialects while letting them speak their own language.