Dryer motors have a thermal circuit breaker built into the motor. When the motor overheats, this will shut the motor off until it cools down. You should
take the dryer apart, make sure every thing turns and freely, and clean all the lint buildup out of the motor. If it then still does the same thing, replace the motor.