Grammatically, the distinction between “that” and “which” when used as reflexive pronouns depends on the distinction between restrictive and non-restrictive subordinate clauses. A restrictive subordinate clause limits the scope of reference of the noun to which it refers, and is thus crucial to the sense of the sentence, while a non-restrictive clause simply provides additional, non-essential information.
In the sentence, “I was wearing the shoes that are under the bed when the fire started,” the clause “that are under the bed” identifies which specific shoes the speaker is discussing, and is thus restrictive. In other words, if one removed this clause, the meaning of the sentence would be significantly altered.
In contrast, in the sentence, “The red lamp, which Fred so likes, was given to us by my cousin,” one can assume that the addressee knows which red lamp the speaker is talking about, and the clause “which Fred so likes” merely works to provide additional information about it. If one removed the clause between the brackets, the significance of the sentence would not be affected, and the clause can thus be considered non-restrictive.
As in these two examples, “that” is used in restrictive clauses, “which” in non-restrictive. It should be pointed out, however, that this is by no means a universal convention in English speech or writing. While the Chicago Manual of Style claims that, “In polished American prose, that is used restrictively to narrow a category or identify a particular item being talked about . . . which is used non-restrictively, not to narrow a class or identify a particular item but to add something about an item already identified,” it also points out that “which can be substituted for that in restrictive clause (a common practice in British English)”. And indeed, the commas either side of the clause probably do more to signify whether it is restrictive or non-restrictive than the pronoun. However, greater clarity is unlikely ever to be a drawback, and the distinction is thus probably one worth observing.
Further guidance on this and other matters grammatical can be found at Grammar Girl. Also, for assistance with or advice on any aspect of your writing, feel free to contact Prose Perfect. We offer friendly, affordable and professional editing and proofreading for all levels of writing, and our free samples mean you can get a clear idea of what you’ll be getting before you commit yourself to anything.