I know that every element has only a certain set of allowed energy states & that the exact energy of these states depends upon the number of electrons, but why is the colour of the light emitted by an element (in GASEOUS STATE) characteristic of the element?

The color of light is determined solely by the energy levels between allowed excited states and occupied states for individual atoms. These are like a fingerprint of an atom.

The color of light emitted by an element in its gaseous state is characteristic of the element because it is determined by the energy levels within the atom. When an atom is in its ground state, its electrons occupy the lowest available energy levels. However, when energy is added to the atom, such as through heating or in an electric discharge, the electrons can jump to higher energy levels, becoming excited.

When an excited electron returns to a lower energy level, it emits a photon of light with a specific energy and wavelength, corresponding to the energy difference between those two levels. The wavelength of light determines its color – longer wavelengths are associated with red light, while shorter wavelengths are associated with blue or violet light.

The energy levels within an atom are determined by its electronic structure, which is characterized by the number and arrangement of electrons in its orbitals. Each element has a unique electronic structure, resulting in a specific set of energy levels and therefore a specific range of wavelengths that can be emitted when electrons transition between them.

Therefore, the specific colors of light emitted by different elements in their gaseous states serve as a unique "fingerprint" or characteristic signature of each element. Through spectroscopy, scientists can analyze the emitted light and identify the elements present in a sample based on their distinctive emission spectra.