here you have information about it:
Basically there are two things you must know:
-"qué" is used to ask for meanings, while "cuál"is used to ask for names.
¿Qúe es Madrid? Es una ciudad. / What's Madrid? It's a city.
¿Cuál es la capital de España? Es Madrid. /What's the capital os Spain? It's Madrid.
-Besides, "qué" is used to ask for something from a group of different things, while "cuál" is used to ask for something from a group of similar things.
¿Qué tenemos que comprar, libros o discos? / What do we have to buy, books or CDs ?
¿Cuál de estos libros tenemos que comprar? / Which one of these books do we have to buy?