It is a condition of Phemosis. The foreskin in such a case is tight and prevents smooth retraction onto the penis. While masturbating, because one is in self control of stimulation, there is not much of a discomfort. However, during sex this is not possible and the discomfort is severe. It can also cause loss of Erectile due to pain while sex. If not corrected, it can predispose towards penis infections.
Next Steps
Kindly consult with a general surgeon. He is an expert in such case. With proper examination and assessment of the severity, the treatment plan can be decided. The correction is mostly a surgical.
Health Tips
Don't worry. It is completely treatable.