Is it safe to eat cooked chicken that has been out for 4 hours?
This would be a scenario like several reputable food safety standards (eg australian) describe as "safe for immediate consumption", others would consider it unsafe. Let all these statements stand, and decide.

To minimize freshness loss and risk: If not leaving home with the pan hot, refrigerate instantly after cooking, probably using cold water around the container, and refrigerate to as cold a temperature as you can manage. In summer weather, ice packs or other cold things kept with the packaging are prudent to use.

Referring to http://foodsafety.asn.au/topic/temperature-danger-zone/ , considering Australia a country having sound scientific basis for their recommendations.