It appears to be a condition of Phemosis. The foreskin in such conditions is tight. There is difficulty in retracting the skin back. At times, it tends to get stuck at the glans, which can be painful. It need immediate attention. There can also be swelling.
Next Steps
Show yourself to a local general surgeon soon.
Health Tips
Nothing very serious. It is treatable.