Discussing how quantum mechanics works, we first defined mechanics, and then we defined a quantum. It turns out light is not the only thing quantized. This is why quantum mechanics is so important: it describes how the matter in atoms, and therefore everything, behaves.
You can think of the nucleus and electrons in an atom as analogous to the sun and the planets. However, there is a major difference: atoms are small, and solar systems are large. The math for solar systems completely breaks down at the atomic level. Around the turn of the 20th Century, scientists were grappling with this.
Neils Bohr proposed that an electron’s orbital levels in an atom were quantized. This makes things work out*: electrons can’t have any energy level (corresponding to an orbiting distance). Instead, they can only have certain well-defined energies. This is quantum behavior, just like observed in light. The two phenomena are related, because for an electron to change energy levels, it either absorbs or gives off a photon, which is the minimum unit of light.
*The Bohr Model is not exactly correct, but is still taught because it contains all the basics of QM and is easy to understand. It really works out only for the hydrogen atom.