Assuming it's a story-driven game, the right number is however many characters you can develop believably and make into important, dynamic characters. FF6 had 14 characters, but Mog, Umaro and Gogo had no characterization, backstory or personality, while Strago and Relm were very flimsy. I love FF6 enough to name myself after it, but Strago and Relm should have been combined into one character named Relm, and at least two of the three optional characters should have been dropped.
On the other hand, if all the characters have no story and just play differently, the right number is however many different gameplay styles you feel you can make. Pokemon has around 150 "characters" per game, but they are all just generic recruitables.
Suikoden tries to combine the two methods, and fails in my opinion. Instead of feeling like the non-important characters are a plentiful source of generic recruitable soldiers, they are made to just feel like shittily-developed characters. About thirty characters are meaningful to the story, about fifty should have been NPCs you never encountered again, and the rest shouldn't have even existed because they're just random unexplained weightlifters who will join you if you bring them bottled water or whatever. The fact that almost all of them play identically just have slightly different stats doesn't help either - my choice of party members has practically no effect, leading me to wonder why the game lets me pick my party at all. Still, making me care about thirty of them is a notable achievement, story-wise.
Fire Emblem has a similar problem, though its permadeaths sort of give it an excuse for doing so. It also never gives you more than three characters that play the same, and you can bring 8-12 characters into each battle. So even if half the characters' personalities amount entirely to nothing more than "mage who likes hamburgers" and "swordsman who is self-conscious about his height" you feel like they at least serve some gameplay purpose.