We have five relative pronouns in the English language: that, which, who (whoever), whom (whomever), and whose. Note that the personal relative pronouns (who, whom, whose) exhibit case: who (subjective case), whom (objective case), and whose (possessive case).
The word that introduces a restrictive or defining clause. The word which introduces a nonrestrictive or nondefining clause, which must be set off by commas. The personal relative pronouns who, whom, and whose also introduce either restrictive (no comma) or nonrestrictive (commas) clauses.
These five words share three characteristics: (1) they introduce a dependent adjectival clause; (2) they serve a grammatical function in that clause, and (3) they refer to a particular noun or pronoun in the main sentence.
The differences between that and which stump even the smartest writers. This issue, along with other intricacies of the relative pronouns, is thoroughly discussed in the eBook Developing a Powerful Writing Style.