Tmj pain after a prolonged dental appointment is a common feature and is self limiting within few days , if the pain still persists , then there are a few non surgical procedures.
Firstly treating the cause, see if the cap is fitted properly or has some occlusion issues.
Alternatively avoid chewy food and refrain from opening mouth widely esp while yawning.
There are some painkillers if the pain is severe.
Application of warm compress followed by some exercises like side to side movements of mandible can be done.
Next Steps
in any case visit a dental centre and they will show you all the required mouth stretching exercises.