There are actually a lot of words for Chinese. This is my understanding.
中文 - Chinese. This means both spoken and written Chinese. 文 means written language, so like Mr Zhang said, if people want to know whether you can read Chinese, they will ask you 你會寫中文, not 你會寫漢語.
漢語 is the language 語 of the Han people 漢族. There are a a bunch of different ethnic minorities here in China 民族. The Han people are the biggest majority. That's where 漢語 comes from.
中國話 - The speech of China. Older people often say this.
普通話 - The language of the common people. This is used to refer to modern day Mandarin, and refers to speech only. This sounds a bit communist, so Taiwanese people will often tease you if you say it, and never say it themselves.
國語 - The national language - this is what they call Mandarin in Taiwan.
華語 - the language of 華人 (ethnically Chinese people). This is what Mandarin is called in Singapore.