'What' is used when there is a very wide or unlimited range of possibilities, while 'Which' is used when there is a limited number of options that are known to both speakers.
There are hundreds of languages in the world, so, as a general question, it would be normal to ask 'What languages do you speak?'. This is the usual way of enquiring about languages.
The only time you might say 'Which languages do you speak?' is if the options are limited and known to both the speaker and the listener. For example:
Where are you from?
Switzerland.
What language is spoken there?
Well, in fact we have four languages - German, French, Italian and Romansch.
So which languages do you speak?
German and a bit of French. How about you? What languages do you speak?
Portuguese. And English of course.
I hope this dialogue explains the difference to you.