To add to Jack's answer, I'll point out that the $a$, $e$, $t$ etc. labels are symmetry labels of the orbitals in an irreducible representation (irrep). They are lower-case versions of their corresponding Mulliken symbols found in character tables. There are four letters that tend to show up in $d$-orbital systems:
- $e$, indicating two-fold degeneracy
- $t$, indicating three-fold degeneracy
- $a$ and $b$, indicating non-degeneracy (or single degeneracy). $a$ ($b$) is picked if the irrep is symmetric (anti-symmetric) with respect to rotation about the principal axis. In addition, $a$ is picked if there's no well-defined $C_n$ or $S_n$ operation.
In the case of $C_\mathrm{3v}$ you can take the principal axis to be $\hat{z}$, in which case it's clear that $d_{z^2}$ must transform symmetrically, and should be labeled $a$.
For non-degenerate irreps ($a$ and $b$), the subscripts $_1$ and $_2$ indicate symmetry and anti-symmetry, respectively, under rotation about a non-principal axis (perpendicular to the principal axis). In case of multidimensional representations ($e$, $t$), the numerical subscript is used to distinguish between inequivalent irreps that aren't separated under other rules.
Finally, you also asked about the $t_{2g}$ and $e_g$ orbitals that show up in e.g. an octahedral environment. Here, the subscript $g$ indicates the wave function is symmetric around an inversion center. $g$ comes from the German word "gerade", meaning even. This can be contrasted with the subscript $u$ for "ungerade", indicating antisymmetry around the inversion center.