The university
You can share information about your mental health condition to the university at any stage - before, or after enrolment on a course. However, you are encouraged to do so as soon as possible.
Universities would prefer to work with you on preventing things being a problem or getting worse for you, and to anticipate difficulties you may encounter, rather than just reacting when things have gone wrong.
Universities have a duty to proactively anticipate the needs of students with any long term health condition (disability) and so you may find that you can access some of the things you need without providing the university with your personal information. However, this is likely to be limited, especially in terms of assessment and exams.
Many Support Services now operate a triaging system to make sure that you receive the support that is best for you. However, general wellbeing and counselling provision can be separate from teaching and learning adjustments, and so it is important not to assume that if you register with one service you will automatically be registered for all. Please ask Support Staff at your university for more information. It is likely that you will be asked to provide some form of medical evidence to register for exam and other reasonable adjustments.
They should also talk to you about Disabled Students' Allowances, which is a form of funding which provides additional software, equipment or human help. This can help you to achieve your study-related goals.