According to Dictionary.com, “that” creates a restrictive clause, which is to say: if you remove the clause starting with “that”, you change the meaning of the sentence. “Which”, on the other hand, creates a non-restrictive clause — one simply adding additional information but not materially changing the meaning of the sentence.
However, as a writer, I don’t really pay attention to those rules. I learned them back when I was taking English classes and working as a tutor and English professor, but nowadays I go with what “feels” right. Sometimes “that” and “which” are interchangeable in my writing; sometimes they’re not. It really just depends.
But what I do know is this: it’s very difficult to write without using either one. I managed it in this blog post, but that was a difficult process which required me to do a lot of editing.
(See what I did there?)