"Which" and "what" each have more than one function in English, but what we're talking about in this post is when they're used as interrogative adjectives, that is, in front of nouns in a question:
Which theater did you say that movie was at?What show did you see?What college did she go to?Which subjects did she study?
In most instances, either "which" or "what" is fine; they're largely interchangeable. So much so, in fact, that when a few of us copy editors delved into our dozens of grammar and usage manuals — and we always love an excuse to do that — we found the topic addressed in only one book, and not our usual go-tos of Garner, Fowler, Bremner and Walsh. Even Strunk and White have naught to say on the topic.
But, if you want to be particular, here's the guideline as found in Karen Elizabeth Gordon's "Torn Wings and Faux Pas":
Never miss a local story.
"Which" is preferred when there is a limited number of choices:Which topping do you want, pepperoni or anchovies?And "what" is preferred with unlimited choices:What foods did you try in Italy?
Before a stated or implied "one" always use "which":Which (one) of your cousins got married last year?
And before "of these," always use "which":Which of these bridesmaid dresses is the least ugly?
Luckily, no one seems to have a problem with using the other interrogative adjective, "whose," besides writing it like the contracted form of "who is."
Thanks to David for suggesting this topic!