I have shoulder pain that feels better when I exercise but the range of motion is limited. What could it be and should I stop excersing.

Frozen shoulder. May benefit from medication and physical therapy. Avoid exercises that over stretch the shoulder but exercise is okay.
Multiple pos causes. A physician needs to examine you, ask a few mor questions and possibly do some tests to give you a helpful answer.
Gentle exercise OK. Maintenance of range of motion is always a laudible goal as long as your pain is not made appreciably worse. Orthopaedic surgeon evaluatin will efficiently elucidate the underlying pathology. More common possibilities include: adhesive capsulitis, subacromial impingement (bursitis), a partial thickness rotator cuff tear, and/or underlying mild to moderate shoulder joint arthritis.