After you cook the chicken you can leave the cooked chicken out of the refrigerator for up to 2 hours.
After 2 hours the chicken even when cooked can start to grow bacteria on the chicken and then you should throw it out.
It's best to refrigerate the chicken within an hour though if you don't plant to eat the cooked chicken to help keep the bacteria from growing on the chicken.
The higher the temperature in the room the less time you should leave the chicken out of the refrigerator so if your room temperature is 90 F or above then you should refrigerate the cooked chicken within 1 hour of cooking it.
Because the higher the temperature in the room the faster bacteria can grow on the food and then that can make you sick.
So refrigerate the cooked chicken as soon as possible to avoid possible food poisoning which is very unpleasant.