You did not give me much to go on so feel free to provide more information.
I will assume that it is a gasoline engine and not a diesel. The term "diesel" when referring to a gas engine means that the engine keeps running for a short time after the ignition is turned off. It will knock and run for a second or two. The causes for "dieseling" are: too high an idle speed; excessive carbon deposits on the piston crown; over advanced ignition timing; near overheating.
None of these issues would stop the engine from running, thus, your stalling issue is most likely not related. You need to let me know more about the symptoms so that I can be of more help.