How many Ph.D. students should a professor advise?There is no single answer. The usual constraints are time and money. It depends on one's teaching, administrative and other time constrains (such as advising Master's and Bachelor students) as well as the ability to fund such students. Also how do you count part-time students, students not in residence, students you officially or unofficially co-advise and students from other schools who are long-time visitors at your institution.
I ideally like to advise three full-time Ph.D. students at any one time. More and I find it difficult to find interesting research problems for the students and not enough time to properly help their research along.
Some professors can handle more students, some should never advise any
students. Particularly in the more applied areas of computer science,
professors need a considerable number of
graduate students to help them with their projects. It's much easier
to tell someone what to code than what to prove.