If the engine will stay running when you give it more throttle then you may have a faulty idle air bypass valve on a fuel injected engine. Why? By giving the engine more gas when it is about to stall you are essentially compensating for a faulty idle air bypass valve by increasing the throttle thus giving the engine enough fuel to stay running.
If the stalling at idle only occurs when the engine is cold then you may have a problem with the cold start valve. Why? This valve gives the engine more fuel for a richer air/fuel mixture that is needed when the engine is cold. Another possibility is a faulty fuel pressure regulator. Why? The fuel pressure regulator maintains proper fuel pressure to the fuel injectors. Problems with this device will likely result in a fuel starved engine thus it will stall.