You can say/use both...but it depends on the rest of what you are saying, the context.
Look at this:
I had spent the whole morning looking for my book, when I suddenly realized I'd lent it to John.
All of this happened in the past. BUT - the 'whole morning searching' happened even further back in time than 'when I realized', 'the searching' happened, and after that, ' I realized' .
"I realized" is past tense, and we indicate that 'the searching' occurred before this, even further back in time, by using "had spent".
I spent the whole morning looking for my book
Here, you are simply telling somebody about something that happened in the past - it could have been this morning or last week or whenever in the past. There is no mention of anything happening before or after it.
Student or Learner