A general rule, although it does not cover all uses, is that you use the simple past when referring to action at some time in the past, and use the past perfect when referring to action up to or before a certain time in the past or other past event.
Examples:
It rained cats and dogs last week. -- SIMPLE PAST It had rained cats and dogs for three days before finally clearing