What does the subscript of atomic orbital mean?
For each azimutal quantum number $l$, the magnetic quantum number $m$ ranges from $-l$ to $+l$. Those give you the number of atomic orbitals "subsripts" you should obtain.
Those are then expressed using spherical harmonics. If you look at the table of spherical harmonics at the $l=1$, you will find that they contain the cartesian axes as $x-y$, $z$ and $x+y$. Therefore it is advisable to form the linear combination out of them, so you get $x$, $y$, $z$. If you go to higher angular momentum, things get more complicated, but there is some tradition what linear combinations to use.

To answer your second question, all this formulas are not some inevitable result you obtain by juggling the numbers. Contrary, it is carefully crafted in a way that the formulas are so simple.