chances are there is a leak in the system that has let all the coolant out, this causes the low pressure switch to activate and cut out the compressor, get a guage set from autozone and check the pressure out
may just need to be refilled or you have a major leak