The stop solenoid is a round switch with a large nex-nut base that screws into the driver's side of the injection pump, in the cast-iron part of the pump where the fuel lines come out. It has a single (usually black or blue) wire that connects to the top of it (either thru a spade terminal, or a single 8mm nut).
When the ignition is on, the solenoid is energized, and allows fuel to flow throught the pump. If there is a bad connection on it, it will cut off the fuel. There are a few stories here of people with loose or broken wires (that have grounded out while the car was running), and they had similar symptoms that you have.
Otherwise, it could be the ignition switch, or a clogged fuel filter.