Brajesh,
I have been struggling with the same issue for a while. But I think I have made some progress.
Which:
Which is used in a non-restrictive context. For eg. Washington DC, which is one of the most cosmpolitan cities, does not have a representative. Also which is preceded by a comma and directly references a noun preceding the comma. Also if you pull out the line with the which from a bigger phrase, it should not change the meaning.
That:
That is used in a restrictive context. For eg. Houses that were destroyed in the earthquake will be rebuilt. Not any house will be rebuilt...only the ones destroyed by the earthquake.