A restrictive clause contains information that limits the meaning of a noun and is necessary in a sentence. For example, in the sentence Any book that you like must be good, the clause that you like is restrictive because it identifies which book: the one that you like.
A nonrestrictive clause, on the other hand, is used to supply additional information that is not essential to understanding the main point of the sentence. Consider this example: The book, which I found at a dusty used bookstore, was a real page-turner.
Luckily there’s an easy way to remember whether to use that or which. If the relative clause contains information that is not essential to the meaning of the sentence, and is also preceded by a comma, a dash, or parenthesis, it’s probably nonrestrictive, so use which. If not, odds are it’s restrictive, so use that.