It depends on what kind of cancer you’re talking about.

The bad news: Some studies have shown a small increase in breast cancer with the use of some hormonal contraception, but other studies have not shown any increased risk. Similarly there is an increased risk of cervical cancer which increases with duration and declines after stopping. However HPV vaccination and regular cervical screening helps reduce risk.

The good news: It’s also important to note that use of hormonal contraception is linked with a reduced risk of ovarian and endometrial cancer. The risk reduces with increased usage (e.g. after 15 years of use the risk of these cancers is approximately half that of women who have never taken hormonal contraception). Although the effect declines over time, it continues to offer protection for several decades.

Hormonal contraception has also been linked to a reduced risk of colorectal cancer.

References

Dr Melville, C. 2015, Sexual and Reproductive Health At a Glance, Wiley Blackwell.