At this stage, I'm going with 2016 given what Federer has said about playing in those Olympics. That would give him a possible 13 more majors to compete at with 4 in 2016 and assuming the 2016 U.S. Open is his last major (like Sampras??). I also think that he could still win another major. I think he's trying to pace himself for this final stretch of his career. Yet, if he wants to hang it up whenever, more power to him. I do not want to see him in as much discomfort as say Agassi was at his last U.S. Open that's for sure.

__________________
Bjorn Borg defied analysis. No one could manufacture a man that won 6 French Open and 5 straight Wimbledon titles. - Andrew Longmore

It's most likely he would retire in 2016, but I would say 2018 is possible, even though by then his ranking would've dropped out of the top 50. I would still love him though and watch his tennis, no matter what his ranking is, even if he's the 1364th ranked in the world!