That's 5 months because you were a full-time student at least part of each of 5 calendar months. You are ineligible for the Retirement Savings Contributions Credit.
From IRS Pub 590-A:
Full-time student. You are a full-time student if, during some part of each of 5 calendar months (not necessarily consecutive) during the calendar year, you are either:
- A full-time student at a school that has a regular teaching staff, course of study, and regularly enrolled body of students in attendance, or
- A student taking a full-time, on-farm training course given by either a school that has a regular teaching staff, course of study, and regularly enrolled body of students in attendance, or a state, county, or local government.
You are a full-time student if you are enrolled for the number of hours or courses the school considers to be full time.