Use that to begin a restrictive clause; use which for everything else.
So what's a restrictive clause? It's the part of a sentence we can't delete to convey the meaning we want.
1. Emails that carry a brief subject line get read more often.
The clause, that carry a brief subject line, is restrictive. If you deleted it, the sentence would read: Emails get read more often—and you've distorted the information. The difference seems obvious. The word that limits or confines (restricts) the type of emails to which we refer.
2. Loud voices, which we hear constantly, annoy us. If you remove which we hear constantly, the meaning of the sentence doesn't suffer.
The which clause adds information,
but it's not vital to the meaning.