At the simplest and most objective level, a color's temperature is simply how close its hue is to either end of the visible light spectrum. But when we try to compare the temperature of two complex colors, it can get a bit more complicated.
For example, imagine that we have a brown and a pale yellow that have the same hue. Is the brown warmer or cooler than the yellow?
You could argue the brown is warmer, because it being darker would mean there are less non-red wavelengths overall. (For our eyes to perceive white or light colors, we need to see the full spectrum of colors to stimulate all 3 cones in our vision. Seeing a bunch of one wavelength isn't enough.)
The point of temperature in art is to help us simplify how colors shift around under different lighting conditions, and the redder the light, the less green light we're going to see reflected, which is necessary for our eyes to perceive a near-white yellow.
Temperature also gets complicated because artists often pick arbitrary colors as the warmest vs coolest instead of following the light spectrum. So you may hear one teacher say yellow is the warmest while another says orange is the warmest etc.
Sometimes, this is a result of working off the color wheel and trying to select colors that are opposite to each other. And sometimes, it's just part of an older lineage (typically landscape painting ones), as something passed down from master to student.
This isn't necessarily bad as a painting practice depending on how it's used, but it's confusing in conversation. One group will be trying to describe the light physics and such associated with temperature and another will chime in to argue about the hue assignments.
While the original concept of color temperature (which is genuinely ancient, like references to this concept nearly predate written record) may have been a subjective one, temperature does have a more technical meaning these days.