Hats are brought from the Hat Shop (also called Dressing Room) by spending Coins, Diamonds or Rubies or Sapphires. The hats do not add any effects to the chickens - they are purely for aesthetic.
There are three Achievements related to buying and wearing hats.