Both mean "language" with some other related meanings.
A friend of mine told me that while 文 refers more to the written language, 语 is more related to the spoken one.
Is this a difference and is it the only one?
Yes, that is the main difference between 文 and 语. And you're right to say they refer more to written/spoken language rather than having that exclusive meaning - when someone talks about 中文, for example, they often mean the spoken language as well as just the written form, while 书面语 refers to literary words usually found in books. The other differences are explained by Fefe's post.
Here is a post (in Chinese) on Baidu Zhidao asking the same question, which comes to the same conclusion: http://zhidao.baidu.com/question/86849931.html
You have given the basic differences. Other meanings may be derived directly or indirectly from the basic meaning. The elaborated explanation can be found at 汉典: 文 语. On the "详细解释" (detailed explanation) tab there are some English translation.
In short, besides what may directly related to language (when the difference is as your have mentioned), there are these other meanings (derived from the basic meaning) as follows:
- natural phenomenon (E.g. 天文, astronomy)
- achievements in culture and education;civilian post (as opposed to military)
- 文教;礼节仪式 [rites]
- 指表现形式;外表 [form;appearance]
- 修饰;文饰 [cover up]
- quantity word:
- used for some kind of old money
- 鸟兽虫类鸣叫 [cry;chirp;roar]
- 特指谚语、古语或成语 [idiom;set phrase;proverb;saying]
- 用以示意的动作或信号 [signal] (E.g. 手语 sign language)
Note the above are only some pickups.
文 comes from an ideogram of a man's chest with a tattoo, referring to a written character.
语, as you may know, has the radical for speech, which is simplified from a mouth with 4 lines that resemble the sound of the voice. I once saw an explanation for the right part, the 五 over 口, but I can't recall it now, will search for it too.