Basically, they are completely different approaches to dimensionality reduction and in practice I can't say I have seen a golden rule to use either of them. But here is explanation for both:
You can think of PCA as finding a linear combination of features such that variance of data is maximized in that combination. So if you suspect that there are linear combination(s) that describe your data -- use PCA.
KMeans on the other hand tries to cluster your data together. Which means that it tries to find centroids such that mean distance is minimal. When we use KMeans as transform we just take distance to centroids. So, if you suspect that data clumps into clusters -- use KMeans.
You can even use both of them together. E.g. Use PCA and then KMeans.
Try which one works better and stick to that.