|Mayor of the City of New York|
|Style||His Honor; Mr. Mayor (informal)|
|Seat||New York City Hall|
|Term length||Four years, renewable once consecutively|
|Constituting instrument||New York City Charter|
|Inaugural holder||Thomas Willett|
|Formation||June 12, 1665|
|Succession||New York City Public Advocate, then New York City Comptroller|
|Deputy||First Deputy Mayor of New York City|
The mayor of New York City, officially Mayor of the City of New York, is head of the executive branch of the government of New York City and the chief executive of New York City. The mayor's office administers all city services, public property, police and fire protection, most public agencies, and enforces all city and state laws within New York City.
The budget, overseen by New York City Mayor's Office of Management and Budget, is the largest municipal budget in the United States, totaling $100.7 billion in fiscal year 2021.  The City employs 325,000 people, spends about $21 billion to educate more than 1.1 million students (the largest public school system in the United States), and levies $27 billion in taxes. It receives $14 billion from the state and federal governments.
The mayor's office is located in New York City Hall; it has jurisdiction over all five boroughs of New York City: Manhattan, Brooklyn, the Bronx, Staten Island and Queens. The mayor appoints numerous officials, including deputy mayors and the commissioners who head city agencies and departments. The mayor's regulations are compiled in title 43 of the New York City Rules. According to current law, the mayor is limited to two consecutive four-year terms in office but may run again after a four-year break. The limit on consecutive terms was changed from two to three on October 23, 2008, when the New York City Council voted 29–22 in favor of passing the term limit extension into law.  However, in 2010, a referendum reverting the limit to two terms passed overwhelmingly. 
In 1665, Governor Richard Nicolls appointed Thomas Willett as the first mayor of New York. For 156 years, the mayor was appointed and had limited power. Between 1783 and 1821 the mayor was appointed by the Council of Appointment in which the state's governor had the loudest voice. In 1821 the Common Council, which included elected members, gained the authority to choose the mayor. An amendment to the New York State Constitution in 1834 provided for the direct popular election of the mayor. Cornelius W. Lawrence, a Democrat, was elected that year.
The mayor is entitled to a salary of $258,750 a year.  Michael Bloomberg, mayor of the city from 2002 to 2013 and one of the richest people in the world,  declined the salary and instead was paid $1 yearly.
In 2000 direct control of the city's public school system was transferred to the mayor's office. In 2003 the reorganization established the New York City Department of Education.
Tammany Hall, which evolved from an organization of craftsmen into a Democratic political machine, gained control of Democratic Party nominations in the state and city in 1861. It played a major role in New York City politics into the 1960s and was a dominant player from the mayoral victory of Fernando Wood in 1854 through the era of Robert Wagner (1954–1965). Its last political leader was an African American man named J. Raymond Jones.
The mayor of New York City may appoint several deputy mayors to help oversee major offices within the executive branch of the city government. The powers and duties, and even the number of deputy mayors, are not defined by the City Charter.
The post was created by Fiorello La Guardia (who appointed Grover Whalen as deputy mayor) to handle ceremonial events that the mayor was too busy to attend. Since then, deputy mayors have been appointed with their areas of responsibility defined by the appointing mayor. There are currently five deputy mayors, all of whom report directly to the mayor. The majority of agency commissioners and department heads report to one of the deputy mayors, giving the role a great deal of power within a mayoral administration.
Deputy mayors do not have any right to succeed to the mayoralty in the case of vacancy or incapacity of the mayor. (The order of succession is the Public Advocate of the City of New York, then the Comptroller of the City of New York. )
"The mayor has the power to appoint and remove the commissioners of more than 40 city agencies and members of City boards and commissions."  These include:
The New York City mayoralty has become known as the "second toughest job in America."  It has been observed that politicians are rarely elected to any higher office after serving as mayor of New York City; the last mayor who later achieved higher office was John T. Hoffman, who became governor of New York in 1869. Former mayor Ed Koch said that the post was jinxed due to divine intervention, whereas Michael Bloomberg has called the supposed curse "a statistical fluke." 
Several mayors have appeared in television and movies, as well as on Broadway, most notably in The Will Rogers Follies. In the 1980s and 1990s, mayors Ed Koch and Rudy Giuliani appeared on Saturday Night Live on several occasions, sometimes mocking themselves in sketches. Giuliani and Mayor Michael Bloomberg have both appeared, as themselves in their mayoral capacities, on episodes of Law & Order. Giuliani also appeared as himself in an episode of Seinfeld, titled " The Non-Fat Yogurt". Giuliani has made cameos in films such as The Out-of-Towners and Anger Management. Bloomberg has appeared on 30 Rock, Gossip Girl, Curb Your Enthusiasm and Horace and Pete.