They are “correlated”, but not causal.
BOTH the available energy states (ground to any excited state) and the atomic number depend on the number of protons fundamentally.
The protons determine the number of electrons, which then defines the number of electron shells that can be filled, and the energy differences between the “ground state” and an excited state.
The atomic number is defined as the number of protons in an atomic nucleus. The isotopes are determined by the number of neutrons.
Because both atomic number and available energy states are linked by the fundamental definitions of each they will be related, but neither “depends” on the other.