As many things - it depends on the situation. :)
"Hvad for en?" can be more casual than "hvilken"
But I believe "Hvad for en" is a tiny(!) little more often used spoken than "hvilken" in the sentences where both can be used. But "hvilken is maybe more safe to use.
for exampel:
"Hvilken vej skal jeg gå?" (which way should I go) is more used/safe than "Hvad for en vej skal jeg gå?". It sound more correct and a little more formal. Which (hvilket) isn't so weird because you often talk to strangers about navigation. But don't worry, people don't care that much about "formal" language in the daily life. :)
But "Hvad for en kage vil du have?" (Which cake do you want) is more commen than "Hvilken kage vil du have?"
When I think of this sentence I picture a mon asking her kid or a friend to a friend. Therefore "hvad for en".
I hope it helped. I'm new sooo.. :)