This normally signals a low refrigerant problem. Also in very hot wheather, the vehicle has a hard time cooling at idle speed. Have the air conditioning system checked for proper refrigerant and leaks.
A car doesnt have to be moving in order for the air conditioning to be cold but the engine must be turned on for it to spin the compressor pully, which makes it cold.