Here is a link to your unit with a wiring digram
Maytag PYE2300AYW Parts List
I assume it runs fine till it turns off re: motor runs etc.
Can you turn the drum fairly easily by hand
A self resetting thermal cutout is likely tripping.
Does the whole dryer shut down or just the heat?
If it is the whole dryer, then your motor is overheating
If it is just the heat then it is a heater thermostat
Remove it from the vent.
Either run it open
OR
Take a pair of panty hose, put one leg into the other and attach this to the dryer.
Give it some room so it can fill like a wind sock
This will prevent any lint from flying about
Run the dryer
If it now runs OK, then it is your vent system.
Check and clean the venting make sure the outside vent works properly
If it still shuts OFF then it is in the dryer
Check the air flow out of the dryer, should be strong
Open the dyer up and give it a good cleaning
Did this fix it?
If not
Does it do it in Timed Dry Cycle?
If it only does it in Auto and Auto Perm Press then it is Thermostat or Safety Thermostat
Does it do it on low heat after the same amount of time?
Then is probably the thermostat
If it only does it on Regular heat then it is probably the Safety Thermostat