Help Pos 1996 Cavalier starting issues

Ok so im trying to figure out what the f is wrong w/ my dads 1996 Cavalier Z24 it has 160k and the 2.4l DOHC motor. The car will start fine when the engine is cold and once running it will run fine… until you shut it off then it wont start for anywhere between 15 mins. to 1hour, once i get it running it runs very rough and i have to floor the gas until i can get it to rev through the rpms smoothly.
i have replaced the cam sensor and the crank postion sensor and it is now throwing code #p0171 which is bank #1 running too lean i have not been able to figure it out, and im trying not to waste money on parts i dont need. I’ve heard there are many things that can cause this, fuel pump, fuel relay, crank sensor. if anybody else has had the same problem w/ cavliers your help would be greatly appreciated.

thanks in advance,
greg