Generally, student loans are not discharged in bankruptcy. In 11 U.S.C. sec. 523(a)(8) there are two exceptions to this general rule:
(A) The student loan may be discharged if it is neither – insured or guaranteed by a governmental unit, or made under any program funded in whole or in part by a governmental unit or nonprofit institution.
(B) The student loan may be discharged if paying the loan will "impose an undue hardship on the debtor and the debtor’s dependents."
Whether an exception applies depends on the facts of the particular case and may also depend on local court decisions. Even if a student loan falls into one of the two exceptions, discharge of the loan will not be automatic. You may have to file an adversary proceeding in the bankruptcy court to obtain a court order declaring the debt discharged.