When does a PhD end? When does a PhD end? I know this is a very general question on this forum, but let us consider a CS-engineering group. What is the usual and primary consideration for letting the student finish officially? 

Is it the number of years spent, when the professor feels nothing more useful will come out of working on the problem (or of the student!)? 

Is it the logical conclusion of the problem and the thesis? A student works to complete a problem in 3 years and publishes a couple of journal papers, and finds there is no more to the problem. Will he be allowed to finish or forced to work on some tangential problem simply to prolong his PhD?
As a general rule, my PhD students need to do two things to get a PhD:


Publish 3-4 papers on a coherent topic, mostly in top-tier theoretical computer science conferences, including at least one paper without me as a co-author (and preferably at least one paper that was previously rejected).
Jump a bunch of administrative hurdles: don't screw up classes, don't screw up TAing, pass quals, gather a committee, propose a thesis, write a thesis, defend a thesis.


That's it.  In my experience, most PhD students do way more than this.

A couple of comments on the original question:


Very few students "finish" their thesis topic.  Equivalently: If a research question can be closed in just one or two papers, it's probably not a good thesis topic.  Good research opens as many new problems as it solves.
Reaching the point where further collaboration with a student is unproductive means the student-advisor relationship has failed.  Sometimes students really do exhaust their research potential, despite their advisors' efforts; in my experience, those students usually don't get PhDs.  (Most successful students reach "critical mass" long before they finish.)  More often, this happens because the advisor isn't giving the student enough appropriate guidance.