Whole is a determiner. We use whole before nouns and after other determiners (my, the, a/an, their) to talk about quantity. We use it to describe the completeness of something:
I’ve wanted to be an actor my whole life.
Please can you check the whole document?
I thought the whole experience was very interesting.
We use the whole of when whole is followed by another determiner (my, her, this, the):
She had been in the same job for the whole of her life. (or … for her whole life.)
We often use the whole of with periods of time to emphasise duration:
At dawn, he would finally fall into bed and stay there the whole of the next day.
We also use whole as an adverb:
He took the cake and swallowed it whole.