When is the image of a 2-dim l-adic representation associated to a modular form open I know the following theorems by Serre:
1, The 2-dim l-adic representation associated to a non-CM elliptic curve is open.
2, The  2-dim l-adic representation associated the weight-12 cusp form $\Delta$ has open image (even before Deligne's construction of 2-dim l-adic representations).
So is there any general theorem about When the image of a 2-dim l-adic representation associated to a modular form is open?
 A: This is more subtle than it looks. I asked exactly the same question some years back (see here); but I'm not going to flag this question as duplicate, because the answer that was given to my question at the time, which was identical to @eric's comment above, was wrong.
The correct answer is this. Let $f$ be a normalized non-CM newform. Associated to $f$ there is a number field $L = \mathbf{Q}(a_n(f) : n \ge 1)$, and for each prime $\mathfrak{P}$ of $L$, we get a Galois representation
$$ \rho_{f, \mathfrak{P}}: G_{\mathbf{Q}} \to \operatorname{GL}_2(L_{\mathfrak{P}}). $$
It is not, however, generally the case that this has open image. There is a trivial obstruction coming from the fact that the determinant of $\rho_{f, \mathfrak{P}}$ is the product of a finite-order character and a power of the cyclotomic character, so there is a finite-index subgroup of $G_{\mathbf{Q}}$ whose determinant lands in $\mathbf{Q}_p^\times$, which is generally much smaller than $L_{\mathfrak{P}}^\times$.
One can still hope that the image contains an open subgroup of $\operatorname{SL}_2(L_{\mathfrak{P}})$, but this also turns out to be false, for a much more subtle reason. Consider the subgroup $\Gamma \subseteq \operatorname{Aut}(L / \mathbf{Q})$ consisting of those automorphisms $\sigma$ for which $f^\sigma$ is equal to the twist of $f$ by some Dirichlet character ("inner twists"). The fixed field of $\Gamma$ is a subfield $F \subseteq L$, and Momose showed that there's a finite-index subgroup of $G_{\mathbf{Q}}$ such that for any $\tau$ in this subgroup $\rho_{f, \mathfrak{P}}(\tau)$ has trace in $F_{\mathfrak{q}}$, where $\mathfrak{q}$ is the prime of $F$ below $\mathfrak{P}$. So if $F_\mathfrak{q} \ne L_{\mathfrak{P}}$, which occurs for infinitely many $\mathfrak{P}$ if $F \ne L$, then the image of $\rho_{f, \mathfrak{P}}$ cannot contain an open subgroup of $\operatorname{SL}_2(L_{\mathfrak{P}})$.
One might still hope that the image at least contains an open subgroup of $\operatorname{SL}_2(F_{\mathfrak{q}})$ but this isn't generally true either -- there is an obstruction coming from a Brauer group, which can genuinely be nontrivial! But this weaker statement does, at least, hold for all but finitely many $\mathfrak{P}$, as was shown by Momose.
If $f$ has level 1, then the group $\Gamma$ of inner twists is always trivial, so $F = L$ and the image contains an open subgroup of $\operatorname{SL}_2(L_\mathfrak{P})$ for all $\mathfrak{P}$. More generally, if $f$ has trivial character it's "usually" the case that there are no nontrivial inner twists. But every non-CM form of non-trivial character has at least one nontrivial inner twist, coming from the action of complex conjugation, so this bad behaviour is unavoidable.
All of this is very nicely explained in Ribet's paper "On l-adic representations attached to modular forms. II" (Glasgow Math. J. 27, 1985, 185--194), which you can find on Ribet's website here.
