There are many reasons why an outboard might start but not stay running for long. This includes starting and staying running until either returning to idle or pushing the choke in, and stalling soon after starting regardless of throttle setting.
The fuel tank breather vent is closed
Fuel tanks need a way to let air in an out of them as the fuel level changes. This is the job of the fuel tank breather.
The fuel pump is faulty
The fuel pump is critical to keeping an engine running.
The carburettor has debris blocking the jets
A very common reason that outboard motors run badly is from dirty in the carburettor(s). This can be from water or other contaminants in the fuel, perished fuel lines breaking up and putting debris into the fuel or varnish from fuel that has evaporated after the engine has been sitting for a long time.
The head gasket on the engine is blown
There is a gasket that seals the cylinder head to the engine block to prevent the combustion gasses escaping and to keep the cooling water (and oil on a four stroke) out of the cylinders.
No two-stroke oil in the fuel
If a two-stroke outboard is run on pure unleaded petrol instead of petrol mixed with oil, the engine will overheat and seize causing it to stall.
Idle speed set too low
Having the carburettor properly tuned is critical for correct idle speed.