How long does ceramic coating last on a car?

A ceramic coating is permanent, it will never come off.

But that doesn't mean it can't wear thin and lose some of its effectiveness. Over time, it will take a battering from the elements, and it won't be as good as when it was first applied. 

A good guide for how long this will take is the manufacturer's warranty. If they guarantee it for 5-years, you can rest assured you will have a highly effective coating for 6-7 years. However, you can extend the effective life of a ceramic coating by giving it a top-up

To give an analogy, if you are painting your living room, you will fill all the holes, sand them flat, wash the walls down with sugar soap, apply a base coat and then a generous coating of top coat. You might even give it a couple of coats, or use a special paint which is easy-clean. It's a lot of work, but worth it for best results. This is permanent and won't come off, but it will pick up some wear, there will be some stains and discolouration, but you can freshen it up with a quick wash of paint.