Conditional ” IF ”
No, it is not necessary to use the past tense in all conditional sentences that use the word “if”.
To put it simply, there are three main types of conditional sentences, called the first, second and third conditionals.
a. In a first conditional sentence.
The word “if” is followed by something that is likely to happen,
“If it rains, we will stay at home.”
Here, we use the present tense in the “if” clause, and “will” + base form of verb (“stay”) in the main clause.
b. In a second conditional sentence, the word “if” is followed by something that is unlikely to happen.
“If I had wings, I would fly.”
Here, we use the past tense in the “if” clause and “would” + base form of verb (“fly”) in the main clause.
c. A third conditional sentence says that something could have happened in the past but didn’t happen.
The sentence you gave as an example almost falls into this category, but I would have to make a correction to your “if” clause, to make it read:
“If I had had some money, I would have bought the book.”
Here, we use the past perfect tense in the “if” clause and “would have” + past participle of main verb (“bought”) in the main clause.
“Had had” is the past perfect form of “have”, consisting of: had (as auxiliary verb) + had (as past participle of main verb)
For further details
click on pages of other uses of conditinal
on the right hand column.