Hi,
Welcome to ehealthforum,
The pain could be related to orgasm itself due to increased blood supply to the organs at time of orgasm and also due to contractions of the uterus as a part of orgasm. Other possibilities include cervical infection, dysplasia, PID, ovarian cysts, or adenomyosis or endometriosis which could also be the reason for painful and heavy periods.
Visit your gynecologist for a thorough check to look for the cause and get started on appropriate treatment at the earliest.
Take care.