I think it's the same as in English. Even though I see what/which used poorly more often recently "what pants do you have?" is bad English. I think you use which for something countable and what for something more abstract. Eg "which day is it?" but "what time is it?". The distinction kind of comes naturally to me.