Things that could cause the heater not to stay on include any accumulation of lint inside the blower intake or a restricted exhaust vent, among others. The usual test for a restricted vent is to take the vent hose off the dryer entirely and run a cycle. If the dryer still does the same thing, then you must open the machine up and take off the front panel to check for internal lint blockage.
Unplug the dryer and raise the main top. To do this, take an old AOL CD and stick it in the front crack about 2" from each side to release some spring clips holding down the top. With the top up, you will see 2 1/4" screws holding the front panel on near the top. Take these off and the front panel will easily pull off and lift off of 2 clips near the floor. Now you can see the blower duct and pretty much everything else. As the 'old stove guy' said in the previous post (
http://appliancejunk.com/forums/index.php?topic=485.msg3682;topicseen#new), the high limit thermostat could be triggering early. This is a small disc with 2 red wires going to it situated over the heater in the back left corner. Sometimes the metal bracket holding the thermostat can warp due to oveheating and it might bend down too close to the heater, causing premature cutoff. You can bend this bracket very slightly upward to give the stat more clearance from the heater, but do not over bend it. We don't want the wires to short against the cabinet.