Command blocks follow the same rules as other blocks, in that they will stop running if the chunk they are located in is unloaded.
This question asked something similar. One solution that was suggested there, by @MBraedley:
The chunks surrounding the world spawnworld spawn are always loaded, so this is the best place to put command blocks that you always want to run. You can change where the world spawn is using the
/setworldspawncommand.