Is it a P0231 Fuel Pump Feedback Voltage Low? Aftermarket scanners don't always have the same descriptions as factory scanners. If that is the code, then the ECM is not seeing the voltage it wants at the lift pump. When the ECM turns on the fuel pump relay, power is sent to the fuel pump on circuit 120, the gray wire at the pump. Circuit 120 then returns to the ECM at pin D5 in connector 1. The ECM should see B+ on the wire whenever the fuel pump is commanded on. I would first go to the fuel pump relay. The truck is stalling and setting the code, so most likely that part of the system is working correctly and power is getting lost somewhere. Now comes the fun part of trying to find where power is going away. Could be as simple as replacing the relay. But, you may also have a wire that is intermittently going open or shorting to ground.
The ECM sends a relay signal to the relay at pin B3 on circuit 465, a dark green wire with a white tracer.
Ground is supplied at pin A1 it's circuit 451 and it's a black wire with a white tracer.
Fuel pump power comes from the ECM B fuse and enters the relay at Pin B1 circuit 440, orange wire.
Power from the relay to the fuel pump leaves the relay at pin A3, that's the circuit 120, gray wire, that the ECM is monitoring for voltage.
Good Luck