OK....so when you turn the key to 'start', it starts, but when you release the key to the 'run' position, it stops running....is that correct ?
Sounds like a bad key switch to me, OR the wire from the switch has broken at some point.
The terminal on the 'run' part of the key switch is not keeping power to your fuel solenoid, and without that power, the spring loaded solenoid plunges forward, cutting off fuel.
First thing I'd do make sure there is a wire on ALL the key terminals on the back of the switch...it may well be one cannon plug. Then take a meter and start checking the terminals for voltage. Should have one hot all the time...your feed. Turn the key to 'run'....got voltage at one more terminal ? That's the one that should keep the tractor running.
If you have no voltage, bad switch. If you DO have voltage, start running the wire.
Does it go to a relay as Murphy said ? Turn key on/off. Relay click? Check terminals on relay for input/output. Clicking means the coil is working, but the contacts can still be bad. Relay OK ?
My money is on bad switch....since the tractor WILL run if you hold the key over a bit. That means the wire/relay are likely ok.