The first condition you will want to impose is that if $N$ is a null-set, then so is $g^{-1}(N)$.
To see this, note that in general $\chi_{M} \circ g = \chi_{g^{-1}(M)}$, where $\chi_{M}$ is the characteristic function/indicator function of the set $M$.
Hence, if there was a null-set $N \subset [a,b]$ such that $g^{-1}(N)$ is not a null-set, then you would have that $\chi_N \equiv 0$ almost everywhere (hence as elements of $L^2$), but $\chi_N \circ g = \chi_{g^{-1}(N)} \not \equiv 0 = 0\circ g $ almost everywhere. This shows that $f \mapsto f \circ g$ would not be well-defined on the level of $L^2$-functions.
In the same way, you want $g$ to be measurable (i.e. you want $g^{-1}(M)$ to be measurable if $M$ is).
Let us now assume these properties. If the map $T$ you define is well-defined, i.e. if $Tf = f\circ g \in L^2$ holds for all $f \in L^2$, then this map is automatically bounded. To see this, it suffices (by the closed graph theorem) to show that if $f_n \to f$ in $L^2$ and also $Tf_n \to g$ in $L^2$, then $g = Tf$. But there is a subsequence $(f_{n_k})_k$ with $f_{n_k} \to f$ almost everywhere and $T f_{n_k} \to g$ almost everwhere, i.e. on the complement of $N$ for $N \subset [a,b]$ of measure zero.
But for $x \notin g^{-1}(N) \cup N$ (which is of measure zero), this yields $$g(x) = \lim_k T f_{n_k}(x) = \lim_k f_{n_k} (g(x)) = f(g(x)) = Tf(x),$$
and hence $g = Tf$ in the sense of $L^2$-equality.
All in all, we have seen that the two questions you are asking are actually equivalent (if you have a general $f$ in mind and not one specific).
Now, if $T$ is bounded, this implies
$$
C \cdot \sqrt{\lambda(M)}= C \cdot \Vert \chi_M \Vert_2 \geq \Vert T (\chi_M) \Vert_2 = \Vert \chi_M \circ g \Vert_2 = \Vert \chi_{g^{-1}(M)} \Vert_2 = \sqrt{\lambda(g^{-1}(M))},
$$
and hence $\lambda(g^{-1}(M)) \leq C^2 \cdot \lambda(M)$ for all measurable $M \subset [a,b]$, where $\lambda$ denotes Lebesgue measure.
Conversely, if this condition is satisfied, then we have (by the Layer cake formula, see $L^p$-norm of a non-negative measurable function):
\begin{eqnarray*}
\Vert f \circ g \Vert_2^2 &=& 2\cdot \int_{(0,\infty)} \alpha \cdot \lambda(\{x \mid |f(g(x))| \geq \alpha)\}) \, d\alpha \\
& = & 2 \cdot \int_{(0,\infty)} \alpha \cdot \lambda(g^{-1}(\{y \mid |f(y)| \geq \alpha)\})) \, d\alpha \\
& \leq & 2 \cdot C^2 \cdot \int_{(0,\infty)} \alpha \cdot \lambda(\{y \mid |f(y)| \geq \alpha)\}) \, d\alpha \\
&=& C^2 \cdot \Vert f \Vert_2^2.
\end{eqnarray*}
All in all, both of your conditions are equivalent to the fact that $g$ is measurable with the additional property
$$
\lambda(g^{-1}(M)) \leq C \cdot \lambda(M)
$$
for all measurable $M \subset [a,b]$.