"My girlfriend can read a little bit of Chinese."
Irl they're most interchangeable afaik, but I think 中文 is more often used for written language.
中文 is more about the literature and the written language. 汉语 - language of the Han people, Chinese. But in many cases you can use both.