I don't think there is such a thing. Once a shinobi, always a shinobi. If you are referring to retiring from serving you country/village, this is another thing. Yes, once you get old enough (at least 50-55 + maybe) you won't be on the front line, that's clear. So you either stop serving your country or you take on an "office" role.