That: That should be used to introduce a restrictive clause. Which: Which should be used to introduce a non-restrictive or parenthetical clause?
Easy-peas right? Well, not quite. Let's break it down and make it into something which is easier for you to digest.
Usage of 'That':
Definition of a restrictive clause: A restrictive clause is an element of the sentence that cannot be deleted, because it restricts the noun. For example: Issues that concern the minorities cannot be ignored.
If a restrictive clause could not be left out of the sentence, a non-restrictive clause is its exact opposite and can be left out without changing the meaning of a sentence. Non-restrictive clauses are either in brackets or have a comma before and after them (or only before them if they come at the end of a sentence).
*Alphanso mangoes, which are grown in 5 countries, are the juiciest variety of mangoes.
*There was a tsunami in Japan, which is horrible news to be honest.
In both the sentences above, the fragment in 'bold' can be easily left.
In essence, if you can remove 'which' from a sentence and the meaning of the sentence is not harmed, that sentence will take a 'which' only. In case the meaning is harmed without 'that' fragment, you need to use 'that'.