I found this phrase while reading about Walter M. Miller Jr.'s excellent science fiction novel
A Canticle for Leibowitz on
Wikipedia. Incidentally, there are so many Latin phrases used in this novel that there is a separate entry in Wikipedia
List of Latin phrases in A Canticle for Leibowitz
It means in English: "Whither the flock may wander, let the shepherd [wander] with them." The useful vocabulary is as follows:
quo whither (where to)
grex, gregis (m) flock, herd
pastor, -oris (m) shepherd
The fact that the word pastor means shepherd explains why some protestant denominations use the word for their ministers. By the same token grex is the ultimate root of the word congregation.