As said above, the minimum will be in your contract, though it is handy if employers have more warning.
I was on a teaching contract so had to give a term's notice, but made it clear that it would be my last year in the October of the academic year, and retired at the end of the Summer term.
You could always have an informal 'heads up - this is what I'm thinking' chat beforehand and then your formal written notice at the specified time if that would be comfortable for you.
More importantly, look forward to your retirement, make plans and enjoy it to the full. It's so well worth waiting for!