This is a question that has been much studied, and until recently there has been no definitive answer. Many people with both bipolar disorder and schizophrenia and their families have told doctors that they believe their disorder was caused by heavy use of a variety of substances. Most frequently people will wonder if their use of hallucinogens (LSD, mescaline, peyote), marijuana, ecstasy, cocaine, amphetamines, etc., may have caused their bipolar disorder. Still others will notice distinct patterns between their mood episodes and their use of drugs and/or alcohol.
Part of what makes this question difficult to answer with a definitive yes or no is that the age of onset of bipolar disorder (most commonly in the late teens through early thirties) corresponds with the time when many adolescents and young adults are experimenting with drugs. So the question becomes, were they going to develop the disorder anyway and is it just coincidental that they were also using substances when this happened?
What is certainly true is that many substances can precipitate symptoms of bipolar disorder in a susceptible person. Stimulants and hallucinogens can set off a manic episode, and cocaine can both start a mania and trigger a crushing depression (especially after a heavy binge).
Beyond this, there is a new body of evidence that supports the theory that individuals who are genetically predisposed to certain psychotic disorders may have these brought on by the use of drugs. One particular gene variant that carries the code for an enzyme (catecholamine O-methyl transferase (COMT) involved in the metabolism of dopamine appears to be triggered in susceptible people by the use of cannabis (marijuana). In other words, if people who have this particular sequence that runs in families smoke marijuana, they greatly increase their risk of developing a serious psychiatric condition.