There's obviously no single answer. Factors that weigh in the mix:
How many guys are "pitcher only" types? The more of those you intend to rely upon, the larger your roster will have to be. The more "two-way" guys you have, the fewer you'll need.
How many games do you play, and how frequently? In Virginia, public high schools are limited by VHSL rules to 20 regular season games, and that frequently means only 2 games per week (though more lately due to rainouts and makeups getting scheduled). Private high schools typically play more games in a more compressed time frame, so they will need more pitching depth. I understand that in many states, the schedules are much longer and they would also need more pitching depth.
The more seniors you have, the fewer sophomores and freshmen you should take on varsity (as opposed to leaving them on JV where they'll play more). The fewer seniors you have, though, the more younger guys you will need, as you'll need to find out who's got a future in your program and who may not.
Be prepared for injuries, suspensions, and even kids who may quit. If you don't have talent parked on the JV team of a caliber that could actually help you at the varsity level should the need arise, you may need to keep an extra junior/senior or two.
Consider the attitudes of the specific individuals who are "on the bubble." Are they team players who'll help and stay positive? Or are they the types who'll poison the dugout atmosphere with their sulking over lack of playing time? Are their parents known for poison pen e-mails?
Perhas baseball17 and RJM would also consider the caliber of moms in the mix, but of course, I would never do such a thing.