You can take the profinite completion $\widehat{\mathbb{Z}} = \prod_p \mathbb{Z}_p$ of $\mathbb{Z}$, then open subgroups of $G( \widehat{\mathbb{Z}})$ correspond to congruence subgroups in $G(\mathbb{Z})$.
The identification is easy:
$$ \Gamma \; congruence \leftrightarrow K \; open$$
"$\rightarrow$": Assume you have a congruence subgroup $\Gamma \subset \Gamma(N)$, then we can consider $$ \Gamma / \Gamma(N) \subset SL_2(\mathbb{Z} / N) = \bigoplus_{p^k || N} SL_2(\mathbb{Z} / p^k ).$$$$ \Gamma / \Gamma(N) \subset SL_2(\mathbb{Z} / N) = \prod\limits_{p^k || N} SL_2(\mathbb{Z} / p^k ).$$ Define $K = K(\Gamma)$ as the pullback of $\Gamma / \Gamma(N)$ along the surjection $$p: \bigoplus_{p} SL_2(\mathbb{Z}_p) \rightarrow \bigoplus_{p^k || N} SL_2(\mathbb{Z} / p^k )$$$$p: \prod\limits_{p} SL_2(\mathbb{Z}_p) \rightarrow \prod\limits_{p^k || N} SL_2(\mathbb{Z} / p^k )$$
"$\leftarrow$": Pick $\Gamma = K \cap SL_2(\mathbb{Q})$, where $SL_2( \mathbb{Q})$ is diagonal subgroup $\prod\limits_p SL_2(\mathbb{Q}_{p})$.