That vs. Which

The relative pronoun that is restrictive, which means it tells you a necessary piece of information about its antecedent: for example, “The color that is used most often is purple.” Here the that phrase answers an important question: which of the many colors are we talking about? And the answer is the one that is used most often.
Which is non-restrictive: it does not limit the word it refers to. An example is “Darlene’s restaurant, which had an outbreak of food poisoning, was the scene of the anniversary dinner.” Here that is unnecessary: the which does not tell us which of Darlene’s chain of restaurants we’re considering; it simply provides an extra piece of information about the plan we’re already discussing. “Darlene’s restaurant” tells us all we really need to know to identify it.
It boils down to this: if you can tell which thing is being discussed without the which or that clause, use which; if you can’t, use that.
There are two rules of thumb you can keep in mind. First, if the phrase needs a comma, you probably mean which. Since “Darlene’s restaurant” calls for a comma, we would not say “Darlene’s restaurant, that had an outbreak of food poisoning.”
Another way to keep them straight is to imagine by the way following every which: “Darlene’s restaurant, which (by the way) had an outbreak of food poisoning. . . .” The which adds a useful, but not grammatically necessary, piece of information. On the other hand, we wouldn’t say “The color which (by the way) is used most often is purple,” because the color on its own isn’t enough information — which color?
from Jack Lynch’s Guide to Grammar
(i changed the words in his examples, his were boring)