This is often misused. I sometimes mess it up myself if I’m not paying attention. However, the rule is fairly simple if you already have a good grasp of grammar and punctuation. Now, understand before reading on, grammar perfectionists will probably object to oversimplifications. However, “grammar minutes” are supposed to be rules of thumb that help you remember the rule. None of these substitutes for getting a good formal education in grammar.
That is used with restrictive clauses, while which is used with nonrestrictive clauses. Restrictive clauses are so named because they restrict the meaning of a part of the sentence, usually a preceding subject. For example:
Bob sold the cars that had more than 100,000 miles for more than they were worth.
Here, Bob only sold cars that were restricted to the group with more than 100,o00 miles. “… had more than 100,000 miles ” restricted the cars. Let’s take an example of non-restrictive clauses.
Bob sold the cars, which were junk, for more than they were worth.
In this sentence, the clause “which were junk” doesn’t restrict the cars. Bob sold all his cars; they just happened to be junk.
Now, here’s the fun part. I never think of restrictive or non-restrictive clauses when I’m writing. There is an easier rule of thumb. (Close your eyes, grammar purists.) Restrictive clauses do not use punctuation before and after. Since the clause restricts the subject, it is not set apart in the sentence. Nonrestrictive clauses, however, require proper punctuation around them, usually at least a preceding comma.
In other words, if your sentence requires a comma, use which. If it doesn’t, use that. If, when writing, you don’t know how to tell whether commas are required, you don’t have a “that/which” problem, you have a sentence structure problem. I would suggest brushing up on restricted/nonrestricted, and dependent/independent clauses. Strunk and White, or a reputable Internet resource can help.