The congruence subgroup problem for a finitely generated group $Gamma$ and $Gleq Aut(Gamma)$ asks whether the map $hat{G}to Aut(hat{Gamma})$ is injective, or more generally, what is its kernel $Cleft(G,Gammaright)$? Here $hat{X}$ denotes the profinite completion of $X$. In the case $G=Aut(Gamma)$ we denote $Cleft(Gammaright)=Cleft(Aut(Gamma),Gammaright)$. Let $Gamma$ be a finitely generated group, $bar{Gamma}=Gamma/[Gamma,Gamma]$, and $Gamma^{*}=bar{Gamma}/tor(bar{Gamma})congmathbb{Z}^{(d)}$. Denote $Aut^{*}(Gamma)=textrm{Im}(Aut(Gamma)to Aut(Gamma^{*}))leq GL_{d}(mathbb{Z})$. In this paper we show that when $Gamma$ is nilpotent, there is a canonical isomorphism $Cleft(Gammaright)simeq C(Aut^{*}(Gamma),Gamma^{*})$. In other words, $Cleft(Gammaright)$ is completely determined by the solution to the classical congruence subgroup problem for the arithmetic group $Aut^{*}(Gamma)$. In particular, in the case where $Gamma=Psi_{n,c}$ is a finitely generated free nilpotent group of class $c$ on $n$ elements, we get that $C(Psi_{n,c})=C(mathbb{Z}^{(n)})={e}$ whenever $ngeq3$, and $C(Psi_{2,c})=C(mathbb{Z}^{(2)})=hat{F}_{omega}$ = the free profinite group on countable number of generators.