In 1986, Gerlach moved back to Ellwood City to challenge Frank LaGrotta in the race for state representative but lost.[4] In 1987, he returned to Chester County to work for the Lamb, Windle & McErlane law firm in West Chester, whose senior partner was then-Chester County Republican Chairman William Lamb.

In preparation for the 1990 election against long time Democratic State Rep. Sam Morris, Gerlach visited 8,600 homes in the 155th District of the Pennsylvania House of Representatives, building his campaign around what he saw as the incumbent's inattentiveness to suburban sprawl. According to a local newspaper, the Daily Local News, Gerlach charged that his opponent was "out of touch" with his constituency.

Gerlach proposed expanding open-space preservation by using zoning laws to encourage developers to incorporate open space into development projects, along with the creation of environmental protection authorities.[5]

During the election, Gerlach's Democratic opponents accused the Western Pennsylvania native of moving to Chester County for the sole purpose of running against Morris. Gerlach denied that accusation and said he moved to Chester County because he and his wife saw it as "a great place to work and raise our kids."

Gerlach was elected to the Pennsylvania House of Representatives by 23 votes out of 17,000 cast. He won re-election in 1992 with 64 percent of the vote. Gerlach was elected to the Pennsylvania State Senate in 1994, with 67 percent of the vote, in the newly re-formed 44th district.[6] He defeated Democrat Barry Robertson (whose campaign was heavily funded by Sam Morris, Gerlach's opponent four years earlier)[7] in that election, and was re-elected in 1998 without opposition. While in the State Senate, he helped change the state's welfare laws.

While in the Pennsylvania House of Representatives and Pennsylvania Senate, Gerlach worked to sponsor legislation making it easier for the commonwealth's patchwork of townships to work together to preserve open space. Gov. Tom Ridge signed Gerlach's legislation into law in 2000.

Gerlach was first elected to the United States House of Representatives in 2002 from the newly created 6th District, sometimes called the "Pterodactyl District" because of its unusual shape.[8] Although the district was reportedly drawn to elect a Republican,[9] he has had a somewhat difficult time holding onto it in elections, largely due to the growing Democratic trend in the Philadelphia suburbs. On January 6, 2014 Gerlach announced that he would not seek reelection, "to spend more time with my wife and family."[10]

In 2003, Gerlach sponsored a new law mandating a new veterans cemetery in the Philadelphia area within four years. The nearest military cemetery to accept casket burials was located 90 miles from Philadelphia.

Gerlach has strongly supported Schuylkill Valley commuter rail. At one point he said of the Bush administration's plan to cut federal money for construction costs from 80 percent to 50 percent: "There's just not going to be enough state and local funds to do the project. It will be a dead project."[11]

The farmland-preservation and open-space advocacy that Gerlach became known for during his tenure as a state legislator has continued during his congressional career. On Sept. 27, 2006, the U.S. House of Representatives passed a Gerlach-sponsored bill H.R. 5313 that would make federal funds available to municipalities around the country to purchase conservation easements.[12] This bill was never acted on by the Senate, and was re-introduced as H.R. 1152 in March 2007.

Gerlach has advocated the passage of legislation that would expand federal regulation of so-called "puppy mills," and cosponsored medical liability legislation.

Gerlach voted against H. Con. Res. 63 which disapproved of The Surge, he said it was meaningless, fundamentally vague and would damage troop morale.[13][14]

He was one of four Pennsylvania Republicans (the others were Todd Platts, Charlie Dent, and Phil English) to vote to add sexual orientation and gender identity to the federal hate crimes bill. Mr. Gerlach also opposes the Federal Marriage Amendment, which would have amended the constitution to define marriage as a union between one man and one women. In 2007, however, Gerlach voted against a bill that would have repealed “Don’t Ask, Don’t Tell.”[15] In 2010, Gerlach also voted against the “2010-2011 Defense Appropriations Act,” which would have included a repeal of “Don’t Ask, Don’t Tell” after military certification and review.[15] Gerlach defended this vote, saying, “Voting on this issue six months before Defense Secretary Robert Gates is scheduled to issue a thorough review of the policy and how best to implement any changes does nothing to improve the security of our country or the morale of the brave men and women serving in our military."[16] In 2007-2008, Gerlach received a 64 percent support rating from the Family Research Council,[17] an interest group whose mission statement commits it to being an organization that “shapes public debate and formulates public policy that values human life and upholds the institutions of marriage and the family.”[18]

In 2010, Gerlach voted against the “Health Care and Insurance Law Amendments,” also known as HR 3590 or “The Health Care Reform Bill.” [15] In a statement on the Health Care vote, Gerlach stated that the bill was “written behind closed doors,” and that it “ushers in a new era of big government.” [16] Gerlach also expressed concerns about the bill’s impact on his constituents, saying “In my district, innovation, investment and jobs in the life sciences and biotechnology sector will be at risk because of a new $2 billion per year tax on items used for cancer screening, knee and hip replacement surgery and other life-saving procedures.”[16]

In 2009, Gerlach opposed HR 2454, which was designed to amend several laws related to energy and the environment, and included a “cap-and-trade” program to limit greenhouse gas emissions.[15] As Gerlach later explained, “While the bill included some positive provisions to develop alternative and renewable energy our country needs, I voted against this bill because of the devastating effect it will have on working families and the people who create jobs in my district and across Pennsylvania." [16] The League of Conservation Voters, “a national non-profit organization that works to turn environmental values into national priorities,”[19] rated Gerlach at 44 percent on their National Environmental Scorecard.[17] In his 2010 campaign, Gerlach received $41,250 from the Energy/Natural Resource sector.[20]

In 2013, Gerlach and Congressman Mike Thompson (D-Calif.) introduced the Conservation Easement Incentive Act. The act would give tax benefits to property owners who preserve their land for conservation.[22]

In their rematch in 2006, Gerlach again beat Murphy by an even narrower margin of 50.6 percent to 49.4 percent (unofficial results as of November 8, 2006). Gerlach was the only member of the "Philly Trio" of vulnerable Republican Congressmen (the others being Curt Weldon and Mike Fitzpatrick) to survive the 2006 election. He overcame a negative political climate that included the then-unpopular war in Iraq, an unpopular president and a well-liked Democratic governor. Geography also played a factor; similar to the previous two cycles Gerlach carried Chester County, Berks County, and Lehigh County by significant margins,[25] while Murphy carried the heavily Democratic Montgomery County portion of the district.[26]

After forming an exploratory committee in February 2009, Gerlach announced his candidacy on July 15 for Governor of Pennsylvania in the 2010 election.[27][28][29] Gerlach ended his campaign for governor on January 7, 2010.[30]