Suppose I have a subgroup of $\textrm{SL}_2(\mathbb Z)$ given by 3 generators, and it happens to be of finite index in $\textrm{SL}_2$. Is there a way (on Sage, since that is what I have access to) to figure out its index? I tried defining a matrix group via the generators and using index(), but this gave me an error. Perhaps if I define the group via permutations it would work? I am new to Sage, so any help would be appreciated.

To add to my comments on @Emmanuel's answer: first, compute the intersection with $\Gamma(2).$ This is quite easy, since $SL(2, 2)$ is not a very large group, and computing matrices mod 2 is not difficult either. Express the generators in words in a generating set of $\Gamma(2)$ (the usual parabolic generators corresponding to $z\rightarrow z + 2$ and $z\rightarrow \dfrac{z}{z+2}$ are always good). Then use www.gapsystem.org/Manuals/pkg/fga/doc/manual.pdf (if @Emmanuel is correct, you can use this from sage. If not, gap is free also...) Alternatively, you can post your three generators... 


I don't know about Sage (which presumably would use Gap for such a thing?) but according to its documentation (I haven't tried), Magma has an algorithm due to CoxeterTodd to (attempt to) find coset representatives for a subgroup of a finitely presented group. Assuming you can represent your generators in terms of some standard generators of SL_2(Z), that might give you the index. See here: 

