Mental health is a serious issue and may certainly be something you'd want to raise with a team leader, but like all choices there are some issues you want to cover. As to who I'd speak with, I would definately arrange to talk with your line manager (the person responsible for your performance, and ulitmately signs your pay check) and a human resource rep, rather than a team or project leader.
The pros of disclosure
Depression is a serious concern, and if left untreated will have an impact on your performance. No one is perfect, and if your performance has been good in the past, a good workplace will understand. They should try to support you. Good staff are hard to find, so helping you to stay healthy is their priority too.
Similarly, your employer may have a special arrangement with a workplace psychologist and can refer you to assist with your recovery.
The cons of disclosure
Without making the problem worse, you need to be aware that a bad workplace may be less understanding, and consider this your problem (it isn't) and may try and use this as a reason to dismiss you (they shouldn't). There may also be insurance issues, depending on where you are located.
Clinically diagnosed depression is a serious health issue, and while in time it can be treated and overcome, you and your employer need to treat it like any illness. I would consider strongly your relationship with your employer and your manager before approaching them, but hope that you work in an area where you can discuss this in the proper manner.