I have had pain in my elbow for a week and when I extend it the pain gets worse. Did I sprain my elbow and how do I treat it?

Tendonitis. It is likely tendonitis and should respond to rest, ice, and anti-inflammatories.
Need more info. Typically sprains are a result of trauma or injury. If you recall a specific injury, then a sprain can be a source of your pain. Be aware of tennis elbow. This is pain about the lateral (outside) of the elbow and can be aggravated by elbow extension or lifting things in an overhand manner. Try ice, Ibuprofen & avoid activities that cause pain. Seek medical care if it doesn't resolve.