If it was purely about which format he's least successful in then Stokes would have retired from international T20 cricket, he's elite in Test and ODI cricket but has never quite cracked international t20. Not yet anyway.
But T20 is where the big money is and in England at least Test cricket is still seen as the pinnacle of the game and as the new skipper he's obviously going to want to give that everything.
Still it's a shame to see him have to step down from a format, you'd hope it would be a warning sign to the ICC and the ECB about how ridiculous the schedule is these days, it gets more mental every year. It feels like England are playing every other day for the rest of the year. To have one of the biggest superstars retire relatively young is a blow for the game.
If things carry on like this I think we'll see this more and more, it's getting almost impossible to play all three formats successfully.