Many people think “that” and “which” are interchangeable, but it’s not the case.
One comma rule is that non-essential information is set off by commas:
1. It rained on Sunday, which made skipping the picnic an easy decision.
2. Adam is good at oil painting, which he practices daily.
3. She loves attending NASCAR races, which she really can’t afford to do very often.
In all of those sentences, the main information comes before the commas. You could leave the information after the commas out and your readers would still understand what you have written, even though they might find the information after the commas helpful or interesting. But it is not essential information (essential to the understanding of the sentence).
Use a comma and “which” to set off non-essential information.
Now let’s look at “that”:
1. It’s a lemon tree that is very close to her kitchen.
2. He drives a car that is 14 years old.
3. They live in the house that his grandfather built in 1920.
In these sentences the information beginning with “that” is essential. If I just wrote the words before “that,” you’d ask, “What lemon tree?” “What car?” “What house?”
Use no comma and “that” to introduce essential information.