In this sense 'whole' and 'all' are synonymous. The only difference is that 'whole' describes one complete concept in its entirity. 'All' here refers to the duration of something (how long it lasts). 'All' is often used with expressions of time. All week, all year etc. But the meaning is the same, it's just the perspective that is different. 'He has lived here his whole life/ all his life.'
Both words have other meanings that are not synonymous.