Your symptoms sound most consistent with posture- and prolonged sitting-related mechanical back/neck pain. Sitting for 7 hours on a hard bench can definitely aggravate it. Anterior pelvic tilt or forward-head posture by itself is not necessarily a disease, and the goal is not to maintain a “perfect posture” all day — changing position frequently is more important.
During class, try to change your sitting position every 20–30 minutes. If allowed, use a small lumbar roll/folded towel behind your lower back and a thin seat cushion. Keep both feet supported and avoid bending forward over your notes for long periods. During breaks, stand/walk for 2–3 minutes.
At home, include 15–20 minutes daily of core strengthening, glute strengthening, hip-flexor stretching and upper-back/scapular exercises. Regular walking is also helpful. Avoid prolonged bed rest.
Next Steps
Since you are having pain for several hours every day, it would be worthwhile to have an orthopaedic/physiotherapy assessment once, especially to check your spine, muscle tightness and strength and to learn an exercise program tailored to you
Health Tips
Seek medical attention sooner if you develop pain radiating down an arm/leg with significant numbness or weakness, bowel/bladder problems, fever, unexplained weight loss, severe night pain, or pain following an injury