Extremely unlikely they will do so in such short timescales.
The reason supermarkets have petrol stations in the first place is to attract customers to the stores, profit from fuel sales is negligible. In 5 years time the majority of cars on the road will still be ICE, any stores which remove petrol stations will become far less attractive for a large proportion of the population compared to their competitors which do still have them.
Realistically I don't see that happening until at least 70% of cars are EVs.
Depends on what is meant by "pulling out of petrol", it could simply mean no further investment in and so as pumps need replacing/upgrading they are closed down.
If that's the case it could be another (say) 3 years before they close all their sites.
However the rose of electric cars is fairly rapid 2018 had just shy if 60,000 EV's (so an average of 5,000/month), in July of this year (and remember July isn't that popular for new car sales, so would typically be below average) there were over 11,000 and made up about 9% of all car sales (more than diesel).
If in sub 18 months it's doubled, let's say it takes 25 months to double and a further 45 to double again then that's at least 40% of all new cars. However as EV's make more sense, even on those figures chances are that the percentage of total miles (not just new cars) could be about 40%.
On that basis, would you really want to stay in the petrol for very much longer than 5 years? As such, 5 years may be a little short but probably not by that much.
However, that's assuming that the doubling process is due to slow down from its current rate.
Of course that's only half the story, as that's only looking at pure EV's, and so it's likely that pure Diesel cars are likely to be rare as new cars within a year and pure petrol probably likewise within 3 years.
If that's the case then there's likely to be a fair number of plug in hybrids, meaning that they'll mostly be looking for fuel for their longer distance travel and probably not the target market of supermarkets.