If your dryer turns on and runs but shuts off before it finishes a load it could be a over-heat sensor shutting it off. The dryer could either be overheating or the sensor is malfunctioning.
One very serious reason that your dryer may be turning off is that it's overheating. Verify that your lint filter is cleaned and the exhaust tubing that runs outside the house is blowing air and it's clogged.