I have been thinking about energy levels of an atom. When we study line spectra of hydrogen atom we say that when electrons jumps back from a higher shell to a lower shell it emits photons of certain frequency, but in that example we say that hydrogen has infinite energy levels and electron can jump back from any level. But when we study bonding we say that some atoms lack in d orbitals and for example say Nitrogen has no d orbitals, but when doing line spectra it has infinite energy level. How these two statements hold up with each other?
The H atom has an infinite number of energy levels spanning a finite energy range. This range is 13.6 eV, the ionisation energy, and is equal to the Rydberg R in energy. In the simplest (basic) theory the energy is $E_n=-R/n^2$, where n is the principal quantum number, $n=1..\infty$) thus as the energy increases the energy levels become closer to one another. The energy also rises (becomes less negative) as n increases.
In addition, for each level n there are other orbitals of nominally the same energy which describe the angular momentum & shape of the orbital. The orbitals are 1s, [2s, 2p], [3s, 3p ,3d], [4s, 4p, 4d, 4f] etc. where the levels in brackets are nominally of the same energy. (However, interaction between electrons changes these energies but only slightly compared to their total energy ).
The light emission (fluorescence) you refer to comes from transitions between any two of these levels (subject to energy and angular momentum conservation). Other types of atoms behave similarly but because there are multiple electrons the equations describing the energy become far more complex.
Thus H atoms do have d orbitals just as do N atoms, but in their lowest energy state there are not enough electrons to fill any of these. The d orbitals only start to become filled as one reaches Sc in the transition metals.
In H and N atoms higher orbitals can be reached, by for example by absorbing photons or imparting energy from fast moving electrons in a discharge. However, in bonding, d orbitals will not be involved in the ground state bonding orbital of a molecule if there are not enough electrons and not enough energy to initially fill the d atomic orbitals. As soon as there are enough electrons, as in transition metal complexes, d orbitals become essential to understanding bonding.
Note: (I'm ignoring ideas such as hybridisation between orbitals)
Note in one case it talks about jumping from a shell to another shell and then in another it talks about the types of orbits.
An atom has an infinite amount of shells available to it, but in each shell there are a finite amount of orbits allowed.
There is a nice discussion of that here : Difference between shells, subshells and orbitals
Nitrogen is filled (in the ground state) at the n=2 shell, so it only has l=0 (s) and l=1 (p) orbits, it can't have d orbits in the ground state.
For more information : Quantum Numbers, Atomic Orbitals, and Electron Configurations