It's a quite common belief that emotions are a factor that may cause cancer. I don't believe this can be scientifically verified, which makes the idea just a myth. I'd like to know where does it come from.
I'll add to HDE's answer that modern spread of the idea that emotional stress "causes" cancer is largely due to "eclectic medical doctor" Eli Jones, who named "worriment of mind" number one cause of cancer in his 1908 book. It is clear from the context that he meant it as a number one cause of cancer spread, but the distinction is lost on modern adherents, who also claim the good doctor had 95% success rate in curing cancer if "taken on by him before any other form of treatment", "at one time, had fifteen physicians under his treatment", and was known as a "doctor's doctor". The guy supposedly was a miracle worker, and has a cult following today.
The myth also fits well with "holistic" view of health common in "eclectic" medicine. Incidentally, it draws on Hippocrates's original theory (c. 400 BC) that cancer is caused by excess of black bile, one of the four humors. Once Avicenna (980–1037) linked humors to "emotional aspects, mental capacity, moral attitudes, self-awareness, movements and dreams" emotional disturbance as a cause of imbalance became plausible.
This being said, a link between emotional state and cancer spread is not a myth. According to Impact of Stress on Cancer Metastasis paper:"Whereas evidence for the role of psychosocial factors in cancer initiation is limited and somewhat contradictory, support is stronger for links between psychological factors such as stress, depression and social isolation and disease progression". There is evidence that stress hormones may accelerate tumor growth or facilitate metastasis. For example, a recent study showed that "cancer cells are able to switch on ATF3 [gene] in immune cells that have been summoned to tumor sites. The result is ATF3 then causes the immune cells to malfunction and allow cancer cells to escape from the tumor and spread to other parts of the body". National Cancer Institute discusses other mechanisms.
This seems to take the idea that emotions can contribute to illness quite seriously, but it does talk a bit about the history of the idea.
According to the author, traditional Chinese medicine, going back a couple thousands years (that time given here), states that emotions can influence diseases of all source. There are some books written today that support the theory, and they all focus on these guiding principles. Though the exact supposed date of the idea is impossible to determine, there is evidence that a 16th/17th century doctor may have had it:
In their section on treatment of breast cancer, the authors refer to a discussion in a Ming Dynasty text by the surgeon Chen Shigong (1555-1636 A.D.) indicating that breast cancer "results from anxiety, emotional depression, and overthinking which impairs the liver, spleen, and heart and causes the obstruction of the channels." This text is also mentioned in The Treatment of Cancer by Integrated Chinese-Western Medicine (4), translated this way:
Breast cancer is due to worry and melancholy. Lots of ideas hanging around make one feel dissatisfied. Perverse flow of liver qi to the spleen leads to the obstruction of the channels and collaterals and congealations due to excessive accumulation.
The page is nicely cited, though some of the sources might not be the best, given the idea they subscribe to. Just because their medical ideas might be wrong doesn't preclude their historical research from being wrong, though.