Loooong time
Before buying our boat (Cat 30, 1983), I called several diesel mechanics with the same question. I was told that the engine, with care, would outlast me! That's all I ask for. We installed plumbing and valves to route the sink drain through the engine (not all the time) so we can fill the sink with fresh water and flush the engine after each use. We can do this even when at anchor at an island. We store the engine by adding radiator anti-corrosive to the sink fresh water and running it through the engine. This little engine sits for 6 months, unused and starts promptly. I worry more about the unused diesel fuel remaining in the tanks as this motor sure doesn't use much of it. We use passive solar down here and an alternator controller for charging. Pretty sunny all the time.