I would use 'what'-- it offers a greater possibility of the listener's being multilingual-- which would be a more polite assumption coming from the speaker. 'Which' suggests that there is a limited choice; 'what' that the choice is unlimited.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
what language do you speak? when is a question.
Which when you don't understand the speaker
Since you are likely asking someone about the known languages on Earth you would use 'which' because those languages are part of a finite list.
Using 'what' would imply that there are unknown languages that a person may speak. I could see it being used in only limited circumstances. E.g. if you are playing with a child and inventing imaginary languages: In this case, asking