Rightly replied by babarhyd and cutepoison.
check you temperature needle. if car is getting heated then the ac compressor will automatically shut off
the problem is with your cooling system not your ac
get it checked for leakages/service the radiator/check coolant for rust etc etc etc