Grounding a guitar pickup is a vital part of being able to obtain a static free sound when channelling the guitar's signal to the amp. This is especially important if you plan on using a large amount of distortion or overdrive in your signal because added gain in your signal chain will amplify noise along with the signal. A properly grounded guitar will ensure you are getting the most out of your tone.
Passive or Active Pickups
Not all pickups need to have a ground going to Earth. You'll need to determine if your pickup is passive or active. Passive pickups do not have any active preamp circuitry and will always need to be grounded to Earth. If your pickup is active, it has a preamp and will not require a ground to Earth because it has a built in ground that's activated through the guitar's input jack.
Being consistent with the process you use for soldering each pickup's ground wire to the guitar's electronic circuit will help you with any future modification or repairs. The most common method is to ground each guitar pickup to the potentiometer that will control the pickups volume. This will allow for the shortest lead wires since the volume pot is the first component in the circuit.
Ensure All Components Are Grounded
Simply grounding the pickup's ground wire to the back of the volume pot will not ground the circuit. Each component should be grounded and connected to a common Earth ground. The most common process is to solder a ground wire that connects each component together and then connect to the guitar's bridge. This provides for a cleaner and more consistent circuit as opposed to running a separate ground to the bridge for each component.
Complete the Ground to Earth
Locate the path of least resistance to run the ground from the circuit to the bridge. If your guitar is a fixed bridge with a base plate, the path of least resistance is from the control cavity to a location directly under the base plate. If it's a tremolo bridge, the path is from the control cavity to the tremolo spring cavity. The ground should be soldered to the tremolo's claw. If the bridge is a Tune-o-Matic bridge, the path should be from the control cavity to the bridge's mounting post on the treble side of the guitar.