In Quantum Mechanics, there is the Schrodinger Equation . The equation is capable determining many properties of a particle in a system based on time and position of the particle.
In a steady state Schrodinger Equation (we are not interested in the time variable);
The equation is #E=-barh^2/(2m)grad^2psi+Upsi#.
#psi# is the wave function of a particle; a function that describes the nature of your particle.
#grad^2=del^2/(delx^2)+del^2/(dely^2)+del^2/(delz^2)# in Cartesian coordinate system.
#grad^2=1/rdel/(delr)(r^2delpsi/(delr))+Sin(theta)del/(deltheta)(Sin(theta)delpsi/(deltheta))+del^2psi/(delphi^2)# in Polar Coordinate system.
Lets see the hydrogen atom, the easiest one.
#E=E_1/n^2#. #n# is the principle quantum number which corresponds to the orbital shell (also energy state).
What we want to do is to solve the Schrodinger equation to find #psi#.
Solving the equation is very tedious and requires arbitrary constants #l# and #m_l#. Refer to Separation of Variables method .
Solving this implies that #psi# has non-zero value if the values of #l# has integer values and does not exceed #n-1# .
!! #l# will determine your orbitals. #n# determines the values of #l#.!!
In other words, if #n=3# you must have #l=0,1 and 2#. Energy level 3 has 3 orbitals.
#s, p and d# orbitals. Other values of #l# in this case will cause #psi# to breakdown.
The electron will cease to exist.
Therefore, if #n=3#, you will have 3 solutions for #psi# based on #l=0,1, 2#.
Sorry if I can't express this any simpler. The history of the atomic model from Neils Bohr onwards is very theoretical.