It does crack me up when in one breath people say Jenson is too old and past it, and in the next quite happily talk about Alonso, a mere year younger, carrying on for three or five years. Kimi is older than both of them!
Because their situations are different. At their current ages no one expects Alonso or Button to improve, the difference is Alonso is one of the best two drivers on the grid, Button is not. Alonso has options, Button doesn't. Alonso wants "I can win the championship" money and can deliver. Button will want big money as well but he's not that good a driver. He got championship winning money to go to Mclaren, no one else will offer him remotely close to the same money again in his last few years in F1.
As we can see, Alonso moving and there is interest, Button probably moving on and no one is talking about snapping him up.
When you get to a certain age either you are one of the very best drivers around and there is still interest, or teams are not able to afford.
There isn't anything fundamentally stopping Button driving till he's 50, the issue is no one will be willing to give him a drive and Button is likely to be unwilling to pay for a drive or drop down to a Sauber/Caterham/Marussia level drive.
Being one of the best drivers keeps options open, when you're not and you're on big wages and at a bigger team, when pushed out, who will be interested at this stage? Even ignoring current drivers in the top teams, would RBR, Ferrari, Merc, Williams or Mclaren(if he were elsewhere) want to buy an ageing driver who isn't bad at all but neither is he great. He's not going to make the difference in winning a title. Mclaren are going to pay big for Alonso precisely because he might make the difference where Button won't.