There are several possible causes but the problem is most likely a motor overheat, The compressor motor for sure, and one hopes the fan motor as well, are protected with a temperture switch called a "Thermal Breaker" if the motor should overheat it shuts the motor off till it cools down.
Now, what can cause this:
A shorted winding on the motor, a bad start switch, an slight overload on the motor.
What can cause a slight overload,,, On an air compressor slight overloads are not only possible but common, The compressor is designed to compress a gas, which is then passed through a condernser, where it is converted to a liquid, the pressure of the gas behind it pushes it to an evaproator via an expansion valve, here it's converted back to gas (Picking up an increadable amount of heat in the process) and returned to the compressor. The compressor is the HEART of the system, and just like your heart it works harder if it has "high blood pressure" (The coolant is the blood) high coolant pressure can be caused by high tempertures, I mean as the heat (outside) goes up so does the pressure, or by an overcharge.
Short story: We had an AC unit in my office at work which was overcharged.. It is hotter than hot and the thing will run for just a couple of minutes before the over-pressure switch kills it, manual reset required. Well, about 1.5 hours into my shift it started raining, now water cools the outside coils much better than air, I hit the reset and it held for the entire shift (One could say I was HAPPY)
It can also be caused by poor lubrication inside the compressor and by other provlems internal to the beast.
Test procedure: Start with a good cleaning, Filters, Evaproator, Condensor and FAN, get as much "Gunk" off everythign as possible.
If this does not fix it, seek professional help