These answers are mostly all wrong.
In bipolar disorder, there is no correlation between intelligence and having bipolar disorder. It is possible that bipolar folks are more creative, however.
In schizophrenia and depression, ON AVERAGE IQ's are lower. But obviously many very intelligent people have these disorders!
Highly intelligent people are LESS likely to have mental illnesses than less intelligent people ON AVERAGE. This is thought to be because the smarter you are, the more likely it is that you will find good coping mechanisms and never come down with the full blown version of things, especially for depression and anxiety disorders. You tend ON AVERAGE to have healthier relationships with others, another major factor in mental health.
So the real link may be that bipolar disorder and creativity go together. Also, milder forms of bipolar cause people to be hard driving when young & take risks, so bipolar does tend to show up in people of higher socio-economic status, ON AVERAGE.
I'm trying hard not to insult any individuals here. Stats NEVER apply to the individual, only to populations.
I have bipolar disorder & read a lot, and have mucho scientific training before I got too nuts to work anymore.