This number is usually an outcome of the system's complexity. The ideal number is the number who can see what is being done, can learn from each repetition, and can thus learn most efficiently. That is, they don't have the opportunity or inclination to drift off. The too-many number is determined when the instructor notices that the practice is being done by only a few and the other students have simply become uninvolved. Therefore, this number is determined by watching the students who wander off, talk about other things, etc., and stop learning.
Twelve is a typical class size only when the method is lecture and demonstration.
When practice is involved, and particularly when the students are working on two or more systems, that number goes way down. In 2, above, a few students may monopolize the practice. The instructor must be aware of and control how much practice each student gets, and must be aware of how well each is performing. The ideal number is how many the instructor can confidently feel he or she can manage. The too-many number is just one more than that.