I'm not sure he did have long-term chronic clinical depression, although he was somewhat melancholic and sensitive. He did have long term problems with anxiety, and it was the anxiety he experienced while staying in a small town in Alaska that he said triggered his relapse into drinking in 2003 after 20 years of sobriety.
I've been watching and reading a lot of his old interviews and, while he does often refer to stress or anxiety, anxiety about just about everything, he really rarely mentioned depression.
He did comment on depression in an interview in 2006...
Quote:On the dark side of comedians
Oh, they have a dark side, I mean, because they're looking at that. In the process of looking for comedy, you have to be deeply honest. And in doing that, you'll find out here's the other side. You'll be looking under the rock occasionally for the laughter. So they have a depressed side. But is it always the sad clown thing? No. But I find comics to be pretty honest people in terms of looking at stuff from both sides, or all sides. ...
I volunteered to be on the cover of a — I think it was Newsweek, for their issue on medication. ... And when the guy said, "Well, do you ever get depressed?" I said, "Yeah, sometimes I get sad." I mean, you can't watch news for more than three seconds and go, "Oh, this is depressing."
And then immediately, all of a sudden, they branded me manic-depressive. I was like, "Um, that's clinical? I'm not that." Do I perform sometimes in a manic style? Yes. Am I manic all the time? No. Do I get sad? Oh, yeah. Does it hit me hard? Oh, yeah.
I get bummed, like I think a lot of us do at certain times. You look at the world and go, "Whoa." And then other moments, you look and go, "Oh. Things are OK."
http://www.npr.org/2014/08/12/339823090/robin-williams-in-looking-for-laughter-you-have-to-be-deeply-honest
In another interview, done not long after his open heart surgery in 2009, that brush with vulnerability and mortality does seem to have changed him. It's also clear in that interview that his 3 year relapse into drinking between 2003-2006 had really messed up his relationships with his family.
http://www.nytimes.com/2009/11/22/movies/22williams.html?pagewanted=all&_r=0
While he wasn't broke, by anyone's standards (he ostensibly had a net worth of about $50 million), he was cash strapped due to his divorces, and he had set up trust funds for each of his three children. So he was under pressure to continue working, just to pay bills, even though he had said he wanted to slow down after his open heart surgery. He really never did slow down, he continued to do his one man tour, to make movies, do a Broadway play, and to complete one season of a new TV series before it was cancelled.
He had no difficulty getting work, an interesting variety of work, but the loss of the TV series this Spring was the loss of a steady paycheck, and it was a career set-back, and that apparently did affect him. He had several long-term projects in the works, including a possible sequel to Mrs. Doubtfire, something he really didn't want to reprise. So he was feeling some stress about finances, and their effect on his career choices, although none of this was very recent, and his financial situation was hardly dire according to those close to him. He continued to work and to earn good money. He had recently put his $29.5 million ranch back on the market, and he considered this "downsizing in a good way."
It is also possible that his open-heart surgery resulted in some depression, or increased a predisposition to depression, because that is not an uncommon consequence of such procedures--and it did make him feel more vulnerable and mortal. But I think his main demons were anxiety and his addiction to alcohol. He had just gone back into an alcohol rehab to allegedly "fine tune his sobriety" but it is quite possible he had already begun drinking again, in response to a variety of stressors, or sources of anxiety, and that's what plunged him into a really deep depression.
He may not have felt the strength to fight the addiction this time around, and he may have felt it would likely destroy his career, if it didn't kill him first, and again put his family through things he would later regret but never be able to undue. He might have felt they would be better off without him now, and that he was better off not going on until he really hit rock bottom. Starting to use alcohol again might have been the final defeat, the riptide of depression that really pulled him under, and he just gave up while he still had his dignity and reputation left.
So, my take, thus far, is that his alcoholism likely became active again, and it provoked a suicidal depression. And that view really isn't at odds with the things others here have been saying.