How does counseling end?

How does a counselor decide when to end counseling sessions or to terminate working with a client?