This article provides a simple guideline for choosing between which and that.
Consider the following sentences. Both are acceptable, but their meanings are subtly different:
The books, which have red covers, are new.
The books that have red covers are new.
In the first sentence, the words "which have red covers" are adding information about the books. That is, they're telling you more about the books than you'd otherwise have known. (They're red, not some other colour.) All of the books are new.
In the second sentence, the words "that have red covers" are limiting which books we're talking about. We're no longer talking about all the books; we're only talking about the ones with red covers. So this time, only the red books are new.
Now, here's our rule of thumb: Use which (surrounded by commas) if a group of words adds information. Use that if it limits the set of things you're talking about.
Here are two more examples just to make that clear:
Classes that are held on Wednesdays are in building 206.
Leap years, which have 366 days, contain an extra day in February.
In the first sentence, the words "that are held on Wednesdays" are limiting the type of classes that we're talking about. (We're not talking about all the classes, only the ones held on Wednesdays.) We thus use that.
In the second sentence, the words "which have 366 days" are adding information. We thus use which surrounded by commas.
Is this difference worth bothering with?
Let's face it, most people are unaware of the guideline set out above. Thus, we can confidently say that most people probably use that and which interchangeably. In most instances, this doesn't cause undue confusion.
In formal business or technical communications (for example, contracts, tenders or technical specifications), though, such ambiguities can give rise to serious legal and financial problems. For example, consider this story from npr.org:
A contract dispute in Canada centers on what's being called a million-dollar comma. Canada's telecommunications regulator has decided that a misplaced comma in a contract concerning telephone poles will allow a company to save an estimated $2 million (Canadian).
In summary, a pedantic attitude to the difference between that and which may be very necessary for business or technical communications.