The number of party members depends on the game you're making. Yes, it's obvious, but a important thing to have in mind when creating the characters.
There are some variables, like the length of the game, the customization of characters, the focus on the characters or the plot, and obviously the genre.
The first one is the simplest, if your game is short (and its an JRPG), why do you need more than 3 to 5 characters? Probably it's too simple to even need an answer.
The second one, it can also be resumed into one question. If you can make your characters whatever you want them to be, why do you need to have a great party? Lots of game gives us the possibility to choose between one armor or another, but if your characters are flexible as chewing gum, you don't really need to have more than the number of different roles they can make in combat (Usually: Warrior, Rogue, Mage, Healer, and nothing more).
The third one is the difficult one, so i'm gonna explain the fourth and then the third, yeah, super-professional. The genre is one of the most important things of all, if not the main thing you need to think. If your game is a classic RPG with class changes, then you should have the same number of characters as the max number of active party members. If the classes are static, then you should think carefully about what they do in combat and why they are different from the other characters, maybe everyone does have a different mix of stats and skills, maybe one character is the same as other but has access to some elemental magic (or whatever) that makes him/her useful in more than one situation... or you just have the classic Warrior, Rogue, Mage, Healer team up.
In strategy games you can have a bunch of characters with different skills and stats, but no big difference between them. Or even have spendable soldiers that are supposed to be a resource but you will end creating a bond with them and when they die you will suffer a lot (Like in every SRPG with permadeath!). I don't think saying a number is gonna make a difference, because some games can have 8 characters and be perfectly fine and others start of with 15 characters ready to die.
If your game is a Dungeon Crawler you can create ten sextillion characters have a bunch of basic classes and every characters fits in one but differs from the others because of having more HP than anyone or having a skill that makes it useful for strategies. In Dungeon Crawlers it's difficult to f*ck up and make a character who is broken and is objectively better than his/her peers. Sometimes, it's intentional and justified via plot, which leads us to the third variable that i skipped.
The way the game handles the plot and the characters should be the second most important thing to define the number of playable characters. If your game is plot-centric, you should create a smaller party, so the player is able to know everyone but can enjoy the world or the plot, most of the time, the first one. If your game is character-centric, then having a larger party, would make the relationships more dynamic and interesting for the player. But always be careful about this, because if your main group is too big, then none will remember more than half of the party and, if you're putting effort into it, it's a shame.
If I have to stay with a number or bunch of numbers, I would choose from 8 to 12. But that's for my kind of preferred games. I wouldn't play a game with 12 characters all the same, nor a Dungeon Crawler with a total of 8 characters.