The short answer is a lot longer than you would expect. Recent EV batteries are very likely to last longer than the rest of the car. That is, the car body is likely to completely to fall apart before you need a battery replacement.
The Electric Viking go into the details. What he will tell you will probably surprise you even if you have studied all the lab reports. Why? Because lab tests are extreme tests. In real world use, batteries last a lot longer that the lab tests predict.