Usually it comes down to breaking down the current loops of your circuit, this generally only comes in to significant play if your circuits are sensitive to small shifts, or very high speeds, where cross talk is significant.
If your circuit is sensitive, e.g. a high resolution ADC, you want to make sure other parts of the circuit can't effect the value your reading, this may mean isolating a portion of the circuits ground, and connecting it to the rest of the circuit at a single point, or by putting a slot in a ground plane to keep larger / noisier currents flowing around that part rather than through,
Traces on a PCB has resistance, so any current flowing through it will create some voltage, depending on how you have routed things, this can cause issues,
In the case of higher speed signals, when the gap between the signal and its return path (sometimes ground, sometimes a differential signal line), changes, it acts a bit like an antenna, either emmiting signals, or risking coupling in others, to this end you try and make sure it has a ground return path under or adjacent to that trace for the entire length of the signal to prevent this.
Personally to reduce some of this when doing layout, I will begin by grouping up parts into functional blocks, if its say some precise analog block, if I can keep most of them sharing the same ground / reference, then it does not matter how that block shifts in regard to the rest of the ground, it just means I need what is measuring the output of that analog block to not vary too much,
To this end, you can mix and match planes, start grounds, and trees of ground traces, its about keeping one part of the circuit from interfering with another, and there is no hard and fast rule of thumb about which is the best in all cases.