I experience pain in my hips and cramping during and after sex and also a day or so after sex. My hips also click and crack on a daily basis. What should I do?

See below. The best an the best answer i can give you is that you should be check out by a competent physician.There are many causes why your hips hurt that could be divided into two categories intrisic(inside)or extrinsic(outside)the hip joint.Intrinsic causes at your age could be developmental issues of the hip(hip dysplasia).Extrinsic most common causes are tendinous in origen (snap.
Deconditioned . I suspect this is muscular i t sounds like you are deconditioned sex is an athletic activity and you need to be in shape for it.
Positioning. This is probably related to putting yourself into positions you are not used to. Try more comfortable positions...Lying on your side, perhaps on top, or "doggie". These may not cause you to stretch you his as much. Then begin a flexibility program to slowly get to positions you prefer.