Is telling my employer that I am quitting because I have depression a bad idea?

I'd say that leaving your job is probably a bad idea, if your depression happens to take a turn for the worse while you're unemployed you may struggle to get back into work for some time, it also doesn't look great on your CV, and unfortunately telling the truth about why you quit may not do you any favours either.
As the first reply here says, the most important thing you can do is to seek treatment for your illness, if you're really in a bad place a doctor will see this and will be able to write you a sick note anyway, so you won't be forced to work at the place you hate. I have had a note for a couple of months in the past, I was physically sick each morning due to the stress of the job, panic attacks at work etc. but after a couple of months with some meds and some counseling I went back and found that I really didn't hate it quite as much as I'd convinced myself I did.
In my opinion if you can rescind your resignation and get some time off sick instead then you'll be in a much better position as regards your near-future employment prospects, I know it might seem like punishment to keep that job for now but you admitted yourself that you aren't exactly thinking straight at the minute, a rash decision here might make life much more difficult for you in the months to come as you're trying to get to a better place and find work again.
Believe me, its much better to be horribly depressed and still employed than to be horribly depressed and not. I'm sorry for the wall of text, and also if this is of entirely no help whatsoever.

/r/AskUK Thread