Grammatically these two words are called determiners. It means that they determine what the noun refers to. All and whole have the same meaning. They both refer to complete group, number or duration, but we use these words differently in a sentence.
At first, let's take a look at the word order. We use such a formula for these words:
the + whole + noun
all + the + noun
Another important thing about word order is the usage with possessive adjectives.
possessive adjective + whole + noun
all + possessive adjective + noun
For example:
My sister ate the whole cake.
My sister ate all (of) the cake.
I spent my whole day reading a book.
I spent all my day reading a book.
Then, ‘whole’ is not used with uncountable nouns.
My sister drank all the milk.
He spent all his childhood in Texas.
Thirdly, ‘all’ and ‘whole’ are used with plural countable nouns. But in this case they have different definitions.
All of the cats like milk. – It means that every cat likes milk.
My brother has to complete writing whole five reports by the end of the evening. – It means that my brother has to finish writing five entire reports.