When to go to hospital?

Ella

Basically I'm 40 weeks, 3 days. Woke up with continuous cramp like when I use to get my period but I do notice sometimes when something worse happens and I'm being squeezed painfully then it calms and turns into the normal cramp again, is this contractions? If so when I time them how do I know when to go to the hospital? How minutes apart and how long are they suppose to be?