Uses of the relative pronouns

As a general rule, who is used for persons only. It may refer to a singular noun or a plural noun.

The student who works hard will win. (Here who refers to the singular noun student.)
The students who work hard will win. (Here who refers to the plural noun students.)
He who hesitates never wins.
They never fail who die for a cause.

Note that who is sometimes used to refer to animals.

Whose

Whose is the possessive form of who. It is used in speaking of persons, animals and inanimate objects.

This is the question whose solution has baffled thinkers of all ages. (More common: This is the question the solution of which has baffled thinkers of all ages.)

The girl in whose pool we swam was very sweet.

Which is used in speaking of animals and objects without life. It may refer to a singular noun or a plural noun.

An opportunity, which is lost, is lost for ever.
This river, which flows through London, is called Thames.
The hotel, at which we stayed, was the cheapest in the town.

Which may also refer to a clause.

The man was said to be mad, which was not the case.
He is not here, which is unfortunate.
He said he hadn’t taken the money, which was a lie.