Most AC systems have a Hi-Pressure Cut-Off switch. If the refrigerant press (and in closed AC systems pressure=temp/heat) gets to high it will shut off the compressor.
If you've serviced the system yourself, and over-serviced it, that could cause it to hit the hi-press switch in warm temps. (AC will work great up to that point).
If you've never serviced it, then being low on refrigerant would NOT cause a great working AC system that cuts out when it gets hot. It could cause an AC system to cut out, but it would perform poorly as it cut on and off.
Fans not working and cooling the condenser enough can cause a good working AC system to cut off, especially at lower speeds where there is less airflow thru the condenser. I had this on a mini-van, it caused the motor to stall at idle as well. There is often a mid-press switch designed to turn on the fan, that can go bad and not turn on the fans and result in what I just described, this was my problem. Fans not working right can raise the underhood temp as well. Don't forget the fan clutch can be bad on the engine driven fan as well.
Finally, you could have a bad clutch coil, they can short from damage, often from heat, and heat effects the resistance properties of electrical devices. Check the resitance of the coil with a good ohm meter, sorry I don't know the specs, but its often a very low resistance for something like an electromagnet, if its lower than spec, it could be bad. Maybe good enough to just work in cooler temps, but when it gets hot, the heat might be enough to push the coil over the edge and not create enough force to engage the clutch.
Air Gap in the AC clutch? Its worn and a greater than spec gap can allow the clutch to slip at higher pressure and temps? You would be getting a lot of squeeling as the clutch engaged though, if that was your problem. They can usually be adjusted by removing shims on the clutch plate and bringing it closer to the other plate, at the spec gap.