You might have tightness in your hamstrings, which are the muscles in the back of your thigh, which itself can be due to a number of reasons, so more information is required to be sure. But going by the most common scenario it might just be a lack of regular stretching and you should focus on some regular exercises.
Next Steps
See if hamstring stretching exercises couple of times a day bring down the discomfort, if not, to seek help with a more detailed description of your symptoms.
Health Tips
Don't do exercises yet if you also have symptoms of nerve stretch like numbness, tingling etc.