I'd say it's very hard to predict. Whether or not his next movie is a big hit isn't what I'm concerned with. Instead, I think back to when The Rock left the WWE. He was in fantastic physical shape, delivering great matches, continuing to refresh his character and his promos, and he went out on top when he could have easily had another solid ten years of in ring competition. But he chose not to, and the story goes on from there. So for me, I look at John Cena, who is obviously older than what Rock was at that point in 2003, and see something quite similar. He isn't a battered, old veteran who can't do it anymore. In fact, I think Cena has aged like wine so far as his match quality is concerned. But his opportunities outside of WWE (whether it's film, television appearances, or just being a celebrity at this point) are stacking up so high that he doesn't need the WWE anymore. Just like when Rock left in 2003, which in retrospect was quite predictable, I think it's quite predictable to believe that Cena could do just the same thing despite the fact that he can still hang with everybody on the roster. But as Rock has said, he had done it all, as has Cena, and depending on what kind of person you are depends on whether you want to continue doing and achieving new things.
What separates Cena from Rock (and I only use Rock as a comparison because he's the closest we have to this situation) is two things really. Firstly, I don't believe Cena can be the movie star that Dwayne Johnson has become. It's immense what Rock has achieved and it's impossible to think of a schedule where he would be regularly appearing in WWE and in Hollywood. So, I don't know if the demand for Cena to step away from the ring would be that great that it would be permanent. And while film isn't all that Cena could do, it seems to be the primary draw away from his wrestling career. Secondly, Cena has been an active member of the main roster since 2002. Over 15 years later, he remains at the top of the card competing in match of the year level bouts. Much like Chris Jericho, his more recent runs have seen him engage in feuds with new and rising stars and has helped raise the stock of many new talents in WWE. No doubt is he still at the top, but his role is clear by now. At his age and at this point in his career, I don't see a clear period where Cena would suddenly decide that he no longer wants or needs to continue competing. Cena could have called it quits a long time ago and it hasn't happened yet. Unlike Rock, he didn't leave when he had done it all, but he continued for the love and support of the business. So I actually wonder whether age will become a factor before any career outside of WWE. And to that notion, a guy like Triple H, who remains in fantastic shape at almost 50, proves that Cena could remain doing what he does now for another ten years to come.
Cena could retire tomorrow, and I'd likely be shocked, but I wouldn't be disappointed considering what he has given for WWE. He could retire in two, three, four, or however many years time. It's unpredictable at this point and I think that's a good thing for us as fans to not have an expiration date to remain focused on, like many fans do with a guy like The Undertaker.