In general, who refers to people, and that and which refer to animals and things. That may also be used to refer to an anonymous group of people ("I want to contribute to a group that saves dolphins").
Professor Thomas, who has taught at the university for forty years, is also a ranger at the local state park.
The whale that swam into the bay was successfully returned to the ocean.
The plane, which flew at an altitude of 30,000 feet, arrived in only 7 hours.
That is used only with restrictive clauses, and which can be used with either restrictive or nonrestrictive clauses, although some writers prefer to use it only with nonrestrictive elements.
A factory that does not take care of its waste stream may violate environmental laws.[restrictive]
After Suzanne left the factory, which is
one of the most polluted Superfund sites in the country, she ran
for Congress. [nonrestrictive]
See also who/whom.