Air conditioner that keeps turning off
Here are some things that you can do:


check the air filter, could be frozen or dirty
check for any possible ice build-up
shut down the system from the breaker for 30 minutes: this will reset the system and allow time to melt any ice build-up. Power back on and see if the temperature holds and the system stays on.


Here is what I would recommend to have a professional do


Verify that the thermostat is working correctly, a bad thermostat would give the results you are getting.
Have the pressure checked. Too much or too little refrigerant can affect the efficiency of the unit and may cause it to cycle too much and shut down.


In my experience, I would tend to lean towards the thermostat since the system works properly after you've powered it off and back on. If the system cannot determine the temperature after a certain period of time (varies by manufacturer) it will shut itself down as a safety feature since it could run indefinitely and cause damage to the system.