The City Watch is a law-enforcement institution charged with acting as the policemen of King's Landing. They are informally known as "Gold Cloaks" due to the gold-colored cloaks their members wear as part of their uniform.
The City Watch of King's Landing is a strong, formally-trained and well-equipped force of guardsmen under the direct authority of the King on the Iron Throne. Their salary is paid by the kingdom as a whole and unlike many of the kingdom's other institutions they do not swear fealty to any lord other than the king.
The City Watch is supposed to double as a defense force in the event that the city is attacked, though prior to the War of the Five Kings a major attack on King's Landing hadn't occurred in generations (the Sack of King's Landing by House Lannister during Robert's Rebellion occurred after their army had already been let inside the gates, and was more of a massacre than a battle). The City Watch are not really true soldiers, as was evidenced by their lack of discipline during the Battle of the Blackwater, when many panicked when the tide of the battle turned dire.
The City Watch promotes by merit, one of the few institutions in Westeros not to recognize the status of birth. Its previous leader was Commander Janos Slynt, a butcher's son who rose through the ranks. Slynt was dismissed by Tyrion Lannister and replaced as Commander of the City Watch by Bronn, a lowborn sellsword in Tyrion's service. After Tywin Lannister assumes his duties as Hand of the King, he dismisses Bronn from command of the Watch.
The leader of the City Watch is referred to as "Lord Commander" when of noble birth, but simply as "Commander" when not. Janos Slynt was merely a "Commander" due to his lack of noble birth. Following Lord Stark's arrest, Janos was named the new Lord of Harrenhal and elevated to the nobility by King Joffrey as a reward for his loyalty. After this point he was referred to as "Lord Commander" Bronn was referred to simply as "Commander", as he was not of noble birth. Nonetheless, there is no functional difference, other than manner of address, if the leader is noble born or not.
Hand of the King Eddard Stark attempts to secure the loyalty of Janos Slynt and the City Watch, through Master of Coin Petyr Baelish, in his attempt to remove Joffrey Baratheon and his mother Cersei Lannister from power. Reluctantly, Stark agrees with Littlefinger's point that they'll need to bribe Slynt to make sure he's on their side. Unfortunately for Ned Stark, Janos Slynt had already been bought by the Lannisters. When Stark and his guards attempted to seize custody of Joffrey in the throne room, the City Watch under Slynt betrayed them, proceeding to slaughter all of Stark's guards in the castle and taking Stark prisoner.
King Joffrey (apparently without Cersei's knowledge), orders Janos Slynt and the City Watch to massacre all of Robert Baratheon's bastard children, even babies. Hand of the King Tyrion Lannister is disgusted with Janos Slynt as a baby-killer, combined with the fact that he betrayed the previous Hand, Eddard Stark, so Tyrion doesn't feel safe having him around. Tyrion has Janos stripped of his position, and exiled to the Wall to join the Night's Watch. He replaces Slynt as Commander of the City Watch with Bronn.
Even Varys later remarks to Tyrion that Bronn is actually performing very effectively as Commander of the City Watch. Bronn was able to restore order following the Riot of King's Landing, and even managed to make a significant drop in theft during the lead-up to the Battle of the Blackwater. Bronn explained that he simply had the City Watch arrest all of the known thieves and hold them indefinitely, fearing the mischief they'd get up to if they faced a prolonged siege. Varys agreed that desperate times called for drastic measures.
After the Battle of the Blackwater, Bronn is relieved of his command of the City Watch after Tywin Lannister returns to King's Landing taking over the duties as official Hand of the King. The City Watch is currently commanded by both Cersei and Tywin Lannister.
In the books
In the A Song of Ice and Fire novels, the Gold Cloaks are a force of some two thousand men, relatively well-equipped. While they promote by merit, they are not incorruptible and some Watchmen have a reputation for taking bribes to look the other way, though Ser Jacelyn Bywater is noted as one of the more honorable members of the City Watch. They are expected to help defend the city if it were to ever come under attack. Oldtown, the second-largest city in Westeros, also has a City Watch. Lannisport's City Watch is trained to high standards and is regarded as the mostly highly-trained feudal foot levy in the Seven Kingdoms. It is unknown if the other two cities in Westeros (Gulltown and White Harbor), or some of the larger towns, have comparable police forces.
Bronn is not actually named as the new Commander of the City Watch in the books, though Tyrion does name him his Captain of the Guards and works closely with the City Watch. Instead, Tyrion replaces Slynt with Ser Jacelyn Bywater, a poor knight from a lesser branch of House Bywater who is commands the Mud Gate and is hated by Slynt because he's an honest man who performed his duties and refused to take bribes. He dies in the Battle of the Blackwater, when his own Gold Cloaks retreat in a panic when they see Joffrey flee the walls and he tries to rally them back into battle. Jacelyn Bywater's role was functionally condensed with Bronn in the TV series (though Bronn doesn't die in the Battle of the Blackwater). The TV series's version doesn't state why Tywin dismissed Bronn, but it was probably because he was not of noble birth - given that he could barely tolerate even Janos Slynt holding the position, because he is a common butcher's son. In either version, Bronn still increased his social position by the end of the Battle of the Blackwater, by being rewarded with a knighthood.
Note that "Gold Cloaks" is consistently written as two separate words, in both the books and the TV series's published materials (including the subtitles as well as the HBO Viewer's Guide and In-Episode Guides).
- The City Watch at A Wiki of Ice and Fire (spoilers from the books)