Master of Coin is a royal official in the government of the Six Kingdoms. The holder is a member of the monarch's small council, the inner cabinet of the realm. The Master of Coin is in charge of the royal treasury, advises the monarch on financial matters, and is responsible for raising money to meet the Crown's needs.
At the start of the TV series, Lord Petyr Baelish is Master of Coin under King Robert Baratheon. Baelish remains in the role when King Joffrey inherits the throne. As Master of Coin, Baelish is regarded as a financial magician, always able to conjure up gold to meet the Crown's demands.
After Tywin was murdered by Tyrion, Cersei seizes control and reorganizes the small council. Stacking the council with men loyal to her by handing out offices as rewards, Cersei appoints Mace Tyrell as the new Master of Coin, in addition to the office he already held as Master of Ships.
In the A Song of Ice and Fire novels, Petyr Baelish was appointed Master of Coin by Hand of the King Jon Arryn, around seven years before the beginning of the narrative. Originally, Jon's wife Lysa had convinced her husband to make Baelish the chief customs officer at the port of Gulltown in the Vale. Baelish excelled at the position, increasing revenue tenfold, so ten years ago Lord Arryn brought him to King's Landing and gave him a minor position in the royal customs office. Baelish increased gross revenues tenfold, and demonstrated such great skill that Arryn rapidly advanced him through a series of promotions, so that within three years he was named Master of Coin for the entire realm. Robert's reign lasted fifteen years in the books (expanded to seventeen in the TV series), and Littlefinger was only Master of Coin for the last seven years, but it is unstated which person (or persons) may have held the position in the early years of King Robert's reign. Thus Baelish is not a holdover from the previous Targaryen small council, in contrast to Pycelle and Varys, who formerly served under the Mad King.
In "A Feast for Crows", Queen Regent Cersei renames the office lord treasurer. She first appoints Lord Gyles Rosby to take the seat, and after he dies - he is replaced by Ser Harys Swyft, who still has this office by the point the novels reached.