Theoretically, k-means should terminate when no more pixels are changing classes. There are proofs of termination for k-means. These rely on the fact that both steps of k-means (assign pixels to nearest centers, move centers to cluster centroids) reduce variance. So eventually, there is no move to make that will continue to reduce the variance.
Running to completion (no pixels changing classes) may require a large number of iterations. In software, we typically terminate when one of the following criteria is met: