The proper use of the relative pronouns who, that, and which relate the subject of a sentence to its object, hence the name. The question of which of the three words to use in a given context vexes some writers; here’s an explanation of their relative roles.
Who, Whom, and Whose
Who and whom refer only to people, and whose almost always does so:
“I have a friend who can help.”
“Whom you associate with is your concern.”
“The person whose jacket was left behind is the likely culprit.”
(Whose is sometimes used to refer to an object, as in “Notice the car whose headlights are off.” This awkward usage should be replaced by, for example, “Notice the car that has its headlights off” or, better, “Notice the car with its headlights off.”)
That refers mostly to things, though a class or type of person is also sometimes referred to by this pronoun:
“He has the key that fits in this door.”
“This is a team that is going places.”
“He’s the kind of doctor that volunteers at a clinic on his day off.”
Even though the previous sentence is technically correct, it’s usually best to maintain a distinction between people and not-people by using who in reference to a type of person: “He’s the kind of doctor who volunteers at a clinic on his day off.” (The use of that in association with people itself, however, is well attested, as in “I don’t like the kind of people that she hangs out with.”) But a class of people is always considered a thing, not a person, so a sentence like “This is a team who is going places” is never correct.
Which, like that, refers to things, but a further consideration is that American English usage usually frowns on this word when it appears in a restrictive, or essential, clause, such as “I chose the card which is blank.” This sentence, which specifies a card among one or more others that are not blank, has a meaning distinct from “I chose the card, which is blank,” which refers to a single card and then describes it. (This is an example of a nonrestrictive, or nonessential, clause.)
To further clarify that distinction, the restrictive form is generally illustrated by using that in favor of which, which is reserved for a nonrestrictive function, as in the preceding phrase. (One exception occurs when which is preceded by another usage of that, as in the sentence “What is good is that which is natural.”)
(This form is sometimes called nonessential because the information that follows which is not required. In the first sample sentence, which is better rendered “I chose the card that is blank,” the card’s blank state is essential to the context. In “I chose the card, which is blank,” all we need to know is that the card was chosen; its quality of blankness is incidental.)
Many writers and speakers of American English deplore the artificial distinction of favoring that over which in restrictive usage, but it is practical and well established — two valid criteria for any variation in purely logical grammar.