中文 emphasizes the written language, while 汉语 emphasizes spoken Chinese. In everyday use, they're interchangeable.
usage
普通话 ('common speech') is the official term for standard Mandarin in mainland China. In Taiwan it is called 国语, the older name for standard Mandarin, used across China before 普通话 was adopted in the 1950s.