Ever engaged in a bout of which-hunting? Confused as to whether which or that should take the place of honor in your sentence?
The answer depends on whether or not your clause is restrictive. No, I don't mean handcuffs. I mean, does the phrase change the meaning of the sentence?
"The car that was painted with flames along its sides could go up to 120mph." This sentence implies that there are multiple cars, so it's necessary to specify which car could go 120mph (the one with flames on its sides.) In this case, your clause is restrictive, because you need to specify which one of the cars can go that speed.
"The car, which had flames painted along its sides, could go up to 120mph." This sentence implies that there is only one car that matters. You could throw out the phrase, and the gist of the sentence would still be understood (the car is fast!) Therefore, your clause is nonrestrictive.
In other words, if your phrase clarifies which object is being discussed, use that. If your phrase is simply adding another description to an object, use which (and usually commas.)
My clock, which was on my bed stand, kept me awake all night. (Non-restrictive: you already know which clock is mine.)
The clock that is on the bookshelf is hideous. (Restrictive: there is more than one clock in the apartment.)
The Canadian goose took the bread that was stale. (Restrictive: the goose did not take the bread that wasn't stale, but there was some non-stale bread around.)
The chipmunk stole the rest of the ham sandwich, which was very tasty. (Non-restrictive: there's only one ham sandwich. It was sadly missed, and no other sandwich will ever be as delicious again.)
If you've already used that to introduce a restrictive clause in a sentence, you may use which to introduce the next. Ex: My die that was blue which always rolled poorly mysteriously disappeared yesterday. (This sentence implies that I have several dice, several of which are blue, and several of which roll poorly.)
Questions? Comments? Examples? Eulogies for dearly departed ham sandwich?
Who vs. Which vs. That from GrammarBook
Which versus That from Grammar Girl
That Vs. Which from DailyWritingTips