I have a significant mental illness, and it really hurt my work in my first grad program. However, something I did early on that was smart was to set up accommodations with the dean of students. Some semesters I never used these accommodations, but I always knew that I had documentation and the deans backing to get extensions/etc. if I really needed it. I was open with a few professors, but not all. It was a religious school, and the people I opened up to there were very compassionate.
In my current program, I have chanced not setting up accommodations. This has allowed me to be more discrete about my illness, but if things went down hill, I'd have a lot of explaining to do. My advice is that unless you have been stable for years, find at least the minimum number of people in the administration or in your department to disclose the illness to, before you have an episode or other problem, so that you are not misleading the department/school and so there are people that can be supportive. Then you can choose to not bring it up with most people without being misleading.There's no shame in having accommodations set up (extensions/extra test time/etc.) even when you don't plan to use them, and there's no shame in using them if you use them.