What's a good way to tell my manager that the timing of my upcoming retirement will depend partly on how big my next raise is, without giving him the feeling that I'm extorting him or giving him an ultimatum?
Being in a financial position to retire (as well as what it implies about your age) generally means that financial pressures have receded and small variations in income become immaterial to major decisions like whether to continue working at all or not.
So unless the raise being considered is an extremely large (and for the employer, a desperate) one, then it might not ring true that your behaviour will be significantly influenced by the raise.
You also say that the decision will only be "partly" influenced by the raise.
To me, it either sounds like a bluff from someone who fully intends to continue working, or it sounds like a non-serious conversation from someone whose dedication or compulsion to work is no longer there, and from that position of security is now chancing his hand on an ego-boosting raise but will ultimately choose to retire for other reasons and will be difficult to retain.
I may well get laid off anyway, since the product I'm working on is not selling well, our team has had other layoffs recently, and I'm probably next in line.
So why would they want to pay anything exceptional to keep you?
So the challenge is how to present it as an opportunity for him to keep me on longer, instead of a threat to leave if I don't get what I want.
What you would have to explain is why the situation is not essentially about you threatening to retire sooner if you aren't given an influential raise! You would have to articulate why your motives are not as bald as that.
You would also have to explain why the prospect of your retiring sooner is something the company would exceptionally wish to avoid even if it only briefly delays the inevitable.
Retirements happen all the time (as do sudden deaths and sickness from older workers) and the disruption will normally be priced in by the employer already.
The employer would also want to avoid every near-retired worker from lodging demands for extreme increases because they think they'll get one, and then the worker retiring prematurely when refusal offends them and they feel obliged to carry through the threat they'd used to reinforce their demand.
So unless you are in a bargaining situation which your colleagues can see is very different from their own, and which your employer knows your colleagues can see is different, they may refuse a raise on principle because it's easier to suffer your loss now than to soon face a chorus of similar demands from your colleagues who would be emboldened by your success.