When do ovarian cysts occur?

Do ovarian cysts only happen around ovulation? Or can they occur at anytime of your cycle? I’m pretty sure I don’t ovulate for another week but whenever I touch my right ovary I feel a sharp pain there. Some people said it could be a cyst. Do they play a role in ovulation? Thanks for the help.