A closed student loan will usually stay on your credit report for a period of 10 years.
After 10 years have passed then the closed student loan is usually removed from your credit report.
Any negative remarks on your credit report though usually cease to hurt your credit rating after 7 years as most other loans or negative credit that was sent to collections are removed within 7 years.