My long-time boss Dr. Margaret Kripke always reminded me to leave the party while you’re still having fun. Not only did she say it, she did it. She retired from her position as Chief Academic Officer totally successful and still enjoying her job. But it was time for her to do other things on her terms.
I wasn’t as clever and had to be pushed out as a vice president and eventually as a faculty member, although I did leave a year ahead of the date I needed to so that I too could do something on my terms.