It sounds like the classic symptom of an exhaust blockage, probably due to a clogged catalytic converter. The converter can overheat and be damaged if excessive amounts of unburned fuel enter the exhaust system. This can happen if the engine has one or more fouled spark plugs or leaky exhaust valves. When this unburned fuel hits the converter, it sends temperatures soaring. The ceramic substrate or pellets that support the catalyst can melt and partially or completely block the flow of exhaust through the converter.
If a complete blockage occurs, the engine will start normally but the exhaust has no place to go. Backpressure quickly builds up and within a couple of minutes the engine quits running. Eventually, the pressure will seep out and allow the engine to restart after it has sit for some time. But the blockage will prevent it from running for long.
The cure here would be to replace the converter. But first, the underlying problem that caused the converter to overheat and fail needs to be diagnosed and corrected -- otherwise the new converter will suffer the same fate.
Other possible causes of this kind of condition include a crushed exhaust pipe, some prankster shoving a potato up your tailpipe, a collapsed inner wall in a double-walled head pipe, or a muffler that's obstructed with rust debris.