When does a PhD end?
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.