During the recent 2021 Annual Meeting of Stockholders Tesla's CEO Elon Musk noted that it will take a few decades until the world will switch entirely to battery-electric vehicles.
The main point is that the global vehicle fleet stands at about 2 billion units, and not even 1% is all-electric yet.
That's a gigantic fleet, which will require time to be replaced with battery-electric counterparts. Assuming that 100% of new vehicles would be electric, at 100 million per year, it would still take 20 years from now to replace 2 billion vehicles. This 20-year period might be considered as the age of a vehicle until it finally goes to a junk yard.
However, currently the global BEV sales share is not even close to 10% (it might be soon on a monthly basis for BEVs+PHEVs), but annually, it appears to be above 5%.
So we need add the time to reach 100% first - globally (all the brands and all the markets). Elon Musk says that the full electrification might take 30-40 years.
While Tesla produces only 100% electric cars, the established manufacturers are at a two-digit share at best and those on the forefront set targets of 100% BEV by 2030. Others assume 2040 or so.
We must also take into account that to achieve 100%, the world needs to make BEVs affordable enough for the countries below average wealth.
On the other hand, the electrification might accelerate through automation of driving. If new autonomous electric cars will be used in favor of owning a car, the global fleet of cars will decrease (the old ICEs will be removed in the first place) and share will increase faster.
Anyway, more than 10 years of lithium-ion-powered revolution is behind us (counting since around 2008, or at least 2010), and a few more decades ahead of us. Meanwhile, the electrification will have to spread to other areas like ships, aircrafts and energy sector (solar + battery energy storage) on a mass scale.