First, realize that "color temperature" is but one axis that runs from amber to blue. Most natural light sources fall fairly close to the color temperature scale, expressed in Kelvin, because the color of a black body radiator is determined by its actual temperature. Stars are black body radiators. So are very hot metals.
In the modern world, though, we deal with a lot of light sources that are not natural and do not fall on the Kelvin scale. The axis that is more or less orthogonal to the color temperature axis is the Magenta ←→ Green axis. This is often called a "tint" or "hue" adjustment. Many artificial light sources, particularly those designed primarily to use low amounts of energy, are quite a distance away from the colors emitted by black body radiators on the Blue ←→ Amber color temperature axis.
So in addition to adjusting color temperature to compensate for our light source, we must also compensate along the tint axis. Many cameras call this white balance correction.
For instance, in addition to having a color temperature of about 3700 K, traditional fluorescent bulbs also emit a green tint along the green←→magenta axis and need correction in the magenta direction. On the other hand, many of the popular LED stage lights found in small clubs are also at about 3700 K but have a decidedly magenta tint that requires compensation in the green direction along the green←→magenta axis. Both types of light are the same basic color temperature but look very different without compensation on the green←→magenta axis that is approximately perpendicular to the blue←→amber color temperature axis.
I've found that when used properly the in-camera White Balance Correction works pretty well with the Canon cameras I use.
With my Canon cameras, each unit of WB adjustment is approximately equal to a 5 mired color correction filter. So a G9 setting is equivalent a 45 mireds green filter (magenta reduction). That's a pretty wide range of adjustment. If the light in which you are shooting exceeds that, then actual gels placed on the lighting might be the next option. In practice, I've usually found that even if a +9 setting in whichever direction(s) I need doesn't get me all the way there, it gets close enough to use an HSL tool in post to pull back the remaining color cast.
Using a correctly colored gel on light sources or glass color filters in front of the lens can allow you to increase the exposure before the strongest channel blows out. This even works when one is shooting to produce monochrome images. Unfortunately most gels are oriented on the blue/purple←→amber axis. Sometimes what you need, say with typical LED stage lighting, is usually a strong green filter to attenuate magenta.
When shooting in such unbalanced light it is particularly important to pay attention to an RGB histogram, rather than a total luminance histogram. The single histogram can fool you into thinking nothing is being overexposed even when, in fact, one channel is being fully saturated. Using the separate red, green, and blue histograms will show very clearly when one channel is much brighter than the others. One channel at full saturation can also make correctly focused images look blurry. Keep in mind that if shooting raw you have a stop or two of headroom beyond what the in-camera histogram, based on the camera generated jpeg preview image, is showing you.
Be aware that when shooting raw the correction will be applied to the jpeg preview, but may or may not be applied by a raw conversion application that you use to open the raw file. Most manufacturer's in house software will apply the in camera setting by default. Most third party raw converters, such as Adobe products that use Adobe Camera Raw, do not.
The further the lights you are using are from the axis along which black body radiators emit (the color temperature axis), the more likely you'll need very fine and customized color corrections. In camera adjustments are fairly coarse compared to what can be done with a good raw conversion application. For instance, in camera WB correction with Canon cameras is limited to integer values (i.e. 1, 2, 3, etc.). In Canon's Digital Photo Professional 4 the gradations are in tenths (i.e. 1.0, 1.1, 1.2, 1.3, etc.). Physical filters are even more limited in terms of the steps between conventional choices.
Beyond doing color correction in two dimensions instead of just one, there's also the issue that many artificial light sources don't emit the full spectrum of visible light.
Most natural light sources do. The sun may be centered on about 5500 K, but there is a little bit of the entire visible spectrum in sunlight. That's generally because the black body radiator is not the exact same temperature over the entire surface that is emitting light. It's also because the Earth's atmosphere absorbs some of the energy radiated by our sun, and lets what we call visible light pass more easily. (Of course the reason we call it "visible light" is because we have evolved to be visually sensitive to the wavelengths of electromagnetic radiation that the atmosphere we evolved in allows to pass most easily!)
With artificial light sources that do not give a broad spectrum of light, there are certain colors we can't reproduce. This is because there is no light the proper wavelength(s) to reflect off our subject for that color. Custom White Balances come in very handy for such lighting. In such cases, we might also have to use an HSL (Hue-Saturation-Luminance) tool in post processing to remove a color cast.
What should I use as a rule to get it right?
Use calibrated test targets, either of various shades of gray or a full color calibration test chart. You can set in-camera "Custom White Balance" with a gray card that will usually get pretty close. The more exotic color test cards require using software installed on your computer to set a color profile to correct for the colors of the test card.
Ultimately, with limited spectrum light sources, you may need to add light of your own to fill the gaps.
For further reading:
How to cancel purple stage lighting on subjects?
Relationship between tint-temp and magenta-green-blue-amber white balance corrections?
How do I get good colors when taking pictures in the city at night?
How to get the most out of low-level monochromatic light?
How does the colour of ambient lighting affect colour rendition?
RAW files store 3 colors per pixel, or only one?
What *exactly* is white balance?