For example, what is the difference between the following two sentences:
I had a bad day
I had had a bad day
'Had' is the past form as well as the past participle of 'have'.
The first sentence is in the simple past tense which typically has this form:
Subject + past form of verb
I had (past tense of have) a bad day.
I reached (past tense form of 'reach') the office late.
The simple past is used normally to denote an action that is completed in the past.
The second sentence is in the past perfect tense which has this form:
Subject + had + past participle of verb
If two non-consecutive events happened in the past, this tense is used to show the first event.
By the time we arrived, the party had begun.
= The party began. Then we arrived.
By the time we arrived, they had eaten all the food!
= They ate all the food; then we arrived.
I had had a bad day already, and I arrived home to find that it had been robbed!
= I was having a bad day. During the day my home was robbed. Then I arrived home and found out about the robbery.
Refer to Kajaco's example as well. Here, the past perfect is used to show which incident/action happened first.
There's an idiomatic difference between "to have a bad day" and "to be having a bad day". The first (mostly) refers to external events and the second (mostly) to your internal reaction to them (mood, headache, etc.) - but there's no bright-line separation between them, just as there isn't in life. Perhaps fully-enlightened Buddhists or Stoics can completely separate external events from their own reactions to them - but then, a fully-enlightened Buddhist or Stoic wouldn't refer to any particular day as being "bad", either.
It might be helpful to ring all the changes on this phrase and see how its meaning shifts:
This evening you will tell your wife, "I crashed the car because I had a bad day." Later this month you will explain to the insurance adjuster, "I crashed my car because I had had a bad day."
Just for fun: http://www.reocities.com/oosterwal/puzzle/had.htm
You are asking about the difference between these. If you are asking about meanings, then the first is a simple statement of fact that stands alone. The second implies another thought coming with it, such as
I had had a bad day at work already, when I got home and discovered the basement was flooded.