I was curious about this too when I first looked into ceramic coating. The lifespan seems to depend on the type of coating and how the vehicle is cared for afterward. I found this article about the ceramic coating service
https://autobodylab.com/services/ceramic-coating/ that explains what the coating is intended to do and what the process involves. In my experience, washing with suitable products and avoiding aggressive cleaning methods makes sense if you want to preserve the finish. I’d also ask the installer how often they recommend