Lifespan depends on usage. SSD cells have a particular number of writes they can perform before they won't hold data anymore. SSDs have technology like wear-leveling to help ensure that the cells are evenly used, and techniques to prevent wasted writes (write-amplification). If the controller detects a cell is getting weaker than expected or has failed completely, there are a number of spare cells available; the controller marks the weak/failing cell as unusable and allocates a spare cell in order to maintain the available capacity. Once the spares have been used up, you'd start losing capacity. If you write 300GB of data every day, the SSD will wear out faster than if you write 100GB per day. Every SSD has a "TBW" rating, TeraBytes Written. If yours has a rating of 600TBW, you can expect to be able to write about that much data safely and after that it might continue to work or could begin rapidly losing capacity and data. Depending on how much you write, that could last 1 year or 7 years. Another drive could have a rating of 3000TBW, so you'd be able to keep using it 5 times as long at the same rate of writes. SSDs also keep track of their own health and usage and report that via SMART, so software such as that provided by the manufacturer (Samsung Magician for example) or third-parties like Crystal DiskInfo will give a health rating that provides a figure to indicate how much of the drive's lifespan remains based on how much writing has occurred and some other factors.
Run one of those utilities and see what they tell you about the health. OEM tools tend to be very simplified and won't show full details. If it's 50%, then you could have another 5 years of usage. If it's 10%, then you're on borrowed time, since the number given isn't exact and could be several percent higher or lower in reality. If you check the health regularly and see that the number is rapidly dropping (but you are not writing a lot of data), then the drive is struggling and should be replaced. The SMART data can show you other details such as whether reallocations have occurred. If there have been a large number of them, your drive might have some factory defects that it has been been able to cover through reallocations and maintain performance and capacity, and it might be a good idea to replace it. If it's just a few after 5 years, that's not entirely unexpected and doesn't indicate a problem.
The Tech Report did a test on several SSDs several years ago and found that they all were able to write multiple times the amount of data that their TBW rating claimed. Manufacturers have to be somewhat conservative about their claims, so that they don't have a bunch of drives that fail long before they reach the rated usage. But in those tests, the amount they could go in excess of the rating varied greatly, so you shouldn't assume anything like all drives should be able to reach double or triple their rating, and in many cases when they did finally fail, they failed without warning and so hard there was no chance to save the data on them. Newer drives that use QLC also have a much lower lifespan than TLC drives like the ones TR tested in terms of write counts for each cell because the tolerance for reading the charge level is lower, although additional spare cells can help mitigate that as well as the overall technology used to create the cells being improved.
For the average consumer who doesn't have any idea how computers work, trying to give any sort of number to the lifespan of an individual component is kind of useless. They just use the thing until it fails suddenly and let someone else figure out why and try to recover their data. That applies to mechanical drives and SSDs, power supplies and fans. But there really is no way to put a number on the number of years an SSD can last. You can sort of say that if a PC is left running 24/7, the fans will probably last X years before they start to grind, or the power supply will likely fail after X years, and a mechanical drive that is on all the time and not allowed to sleep will eventually fail, but you can't put a single number on any of those parts across all brands and prices. And with an SSD, there simply is virtually no "wear" on the device that occurs simply from being turned on like those other components, and therefore no specific lifespan. A low usage drive could be left turned on for a decade or more with no problems.