If I recall correctly, "that" is for restrictive clauses while "which" is for non-restrictive ones, i.e. you use "that" when your relative clause narrows down the preceding statement and "which" when it simply adds to it. But I tend to mix that up all the time, and nobody has ever complained

The car that hit me was white.
The car, which looked brand new, was faster than my bike.

Basically, it all boils down to commas. If I need commas (which are, in turn, just a shortcut for appending a relative clause with "and", making the main clause and the relative clause equally important) I use "with".