It does sound like you may have pulled a muscle, which essentially is just bruising and inflammation inside the muscle from too much stretching. Most of the time, pulled muscles will heal on their own, as long as you take the time to rest properly and not resume vigorous physical activity until all the pain is gone. Additionally, it is often helpful to take an anti inflammatory medication such as ibuprofen or naproxen, although you should talk to your primary care doctor
first to make sure that those medications are safe in your case.
If there is any significant swelling, or if the pain worsen, then you should get in to see your doctor right away. Swelling might be a sign of a significant bruise
in the muscle, or it might be a sign of an ankle sprain (if the swelling is around the ankle). Again, treatment for these two problems generally involves rest and anti inflammatory medications, but more severe cases may require other treatments as well.
Your doctor will be able to examine the leg and make sure that there is nothing serious going on. They can also give you advice about when to resume physical activity and which pain medications to take.