Chronic depression is a pretty complex issue. Usually your predisposition to it is inherited genetically. I've been suffering from bouts of depression since I was about 18, so that makes it around seven years. Eventually I found out that it runs in my family, which made me feel better because for some time I thought it was something wrong with just me.
What has helped me a lot is cardiovascular exercise (running about 20 minutes 3-4 times a week). This makes a huge difference in how you feel in general. Also, I've also found Steve's
Overcoming Depression article very helpful. One time I was able to apply those techniques to get out of a depressive episode in just one day. Currently when I get depressed it usually doesn't last more than a few days, a week tops.
Finally, I have to say from personal experience that depression is usually induced by triggers. Something happens that causes you to start a chain of depressing thoughts, and if you don't take control quickly a chain reaction will occur putting you into a full-fledged depressive episode. A good analogy is a nuclear reactor. If they don't use the lead rods to control the magnitude of the nuclear reaction, an uncontrolled chain reaction (explosion) will occur.
It's the same with depression. The most effective way to stop it is to not let it start. It takes time to train yourself to recognize when you're starting to spiral into negative thoughts (that's really what depression ultimately is -- a self-sustaining cycle of negative thoughts), but once you're able to recognize that you're starting this cycle you can quickly neutralize it by interrupting your train of thought. Perhaps eventually it's possible to get so good at this that you can prevent depressive episodes completely.