Konami will never let him move away from the franchise. Unless he breaks with Konami my guess is he is making MGS games until he retires.
Konami would absolutely let him move away from the franchise. Kojima won't move away from the franchise.
He'll never respect a Metal Gear Solid game without 'A Hideo Kojima game' on the cover. When you think about the Rising situation, I imagine how difficult it must've been trying to develop that with Kojima outwardly voicing the fact the he doesn't think his team is capable. And a game like Portable Ops is just erased from meaningful existence because Kojima didn't direct it.
He could stop making MGS games if he was willing to pass the baton. I'm sure of it. But no, it's Kojima Productions after all (even Quantic Dream isn't called Cage's Game Development Studio) and Kojima doesn't seem willing to give his team the opportunity to try, and fail, and eventually succeed. They had a new genre to try to understand, and rather than being given the time to make a good game, Kojima canned it and gave it to someone more experienced. That's brutal. It's almost like they were set up for failure, just because the expectations are so ridiculously high.
So he likely will be making MGS games until he retires. But I imagine it's more of an ego thing, than a contractual obligation.