The process goes on until:
all candidates except for one drops out
or
One candidate reaches the magical number of delegates that assures them the nomination (For dems...I think it is a little more than 2000 needed)
or
the convention happens. This is where....if neither candidate wins the magic number of needed delegates...the "super delegates" actually cast the final deciding votes. This is where it can get interesting as the supers are not bound by anything.
...whichever of those events happens first...will be what ends the nomination process.
For the Republicans...it technically ended when McCain reached the magical delegate number. That is when the Huckster dropped out. however...it was over long before that as the numbers were such that Huck had no chance of even coming close to overtaking McCain's delegate count. He stayed in it...most likely to up his chances at a VP nom.