"That" is used in restrictive clauses that provide essential information, while "which" is used in non-restrictive clauses that provide additional information. "That" is not preceded by a comma, whereas "which" is preceded by a comma.