What is difference between T1g and T2g?
Well, not quite. Here's the quick summary on subscripts in Mulliken notation for point group symmetry.

“g” stands for "gerade" and refers to the symmetry around an inversion center. (That is, the representation retains symmetry around the inversion center.) Yes, octahedral ($O_\mathrm{h}$) molecules have an inversion center, but so do others.

“u” stands for "ungerade" and refers to anti-symmetric around an inversion center.

“1” or “2” refer to symmetry (1) or anti-symmetry (2) around a secondary $C_2$ axis (e.g., in a $D_x$ point group like benzene).

The $'$ and $''$ assignments (if needed) are used for symmetry around the $\sigma_\mathrm{h}$ operation.

And, while you didn't ask, for “A” versus “B”, these are one-dimensional representations that differ with respect to the "main" rotational axis. “A” representations are symmetric “+1” and “B” are anti-symmetric “−1” for that axis.

You only need enough subscripts to uniquely identify a representation. For example, here's the character table for $D_{4h}$:

$$\begin{array}{c|cccccccccc|cc} \hline
D_\mathrm{4h} &amp; E &amp; 2C_4 &amp; C_2 &amp; 2C_2' &amp; 2C_2'' &amp; i &amp; 2S_4 &amp; \sigma_\mathrm{h} &amp; 2\sigma_\mathrm{v} &amp; 2\sigma_\mathrm{d} &amp; &amp; \\ \hline
\mathrm{A_{1g}} &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; &amp; x^2+y^2,z^2 \\
\mathrm{A_{2g}} &amp; 1 &amp; 1 &amp; 1 &amp; -1 &amp; -1 &amp; 1 &amp; 1 &amp; 1 &amp; -1 &amp; -1 &amp; R_z &amp; \\
\mathrm{B_{1g}} &amp; 1 &amp; -1 &amp; 1 &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; 1 &amp; -1 &amp; &amp; x^2-y^2 \\
\mathrm{B_{2g}} &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; &amp; xy \\
\mathrm{E_g} &amp; 2 &amp; 0 &amp; -2 &amp; 0 &amp; 0 &amp; 2 &amp; 0 &amp; -2 &amp; 0 &amp; 0 &amp; (R_x,R_y) &amp; (xz,yz) \\
\mathrm{A_{1u}} &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; -1 &amp; -1 &amp; -1 &amp; -1 &amp; -1 &amp; &amp; \\
\mathrm{A_{2u}} &amp; 1 &amp; 1 &amp; 1 &amp; -1 &amp; -1 &amp; -1 &amp; -1 &amp; -1 &amp; 1 &amp; 1 &amp; z &amp; \\
\mathrm{B_{1u}} &amp; 1 &amp; -1 &amp; 1 &amp; 1 &amp; -1 &amp; -1 &amp; 1 &amp; -1 &amp; -1 &amp; 1 &amp; &amp; \\
\mathrm{B_{2u}} &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; 1 &amp; -1 &amp; &amp; \\
\mathrm{E_u} &amp; 2 &amp; 0 &amp; -2 &amp; 0 &amp; 0 &amp; -2 &amp; 0 &amp; 2 &amp; 0 &amp; 0 &amp; (x,y) &amp; \\ \hline
\end{array}$$

Note that all the “g” representations have +1 or +2 for the character of the “$i$” symmetry operation. We don't need “1” or “2” to distinguish the $\mathrm{E_g},$ but we do for the different $\mathrm{A}_{x\mathrm{g}}$ representations. For those, we go to the $C'_2$ axis, which separates $\mathrm{A_{1g}}$ from $\mathrm{A_{2g}}$. These are unique and we don't need to assign $'$ or $''$ for this point group.

(If you look up the $D_\mathrm{3h}$ character table, you find $'$ and $''$ needed.)