1st sentence - use it is you are comparing the past to your ongoing life.
"That was the worst day I have ever had." (There has never been a worse day before or since then.)
2nd sentence - use it is you are comparing the past to your life in the past.
"That was the worst day I had ever had." (When it happened, it was the worst day of my life, but I've since had worse days).