The Liberal Democrats gained four seats in last week's election, bringing their total to 12.
Despite some successes, the campaign was criticised for focusing on a second European Union referendum and Farron's appearances were dominated by questions over his views on gay sex and later on abortion.
He said he had been torn between his religion and serving as a political leader.
The Liberal Democrats, with Nick Clegg at the helm, helped David Cameron's Conservatives form a government in a coalition agreement after a hung parliament result in the 2010 election.
The Lib Dem peer, formerly the Metropolitan police's deputy assistant commissioner and the UK's most senior gay police officer, has stood as the party's mayoral candidate in past elections.
After days of pressure to clarify his stance on the issue, he finally made clear he did not, but continued to face questions in interviews.
Liberalism means that I am passionate about defending the right and liberty of people who believe very different things to me.
"I seem to be the subject of suspicion because of what I believe and who my faith is in", he added.
"I'm not a man of faith, but I'm sure I was not alone in being moved by the way Tim spoke about the struggle he found in balancing his faith and his politics".
"To be a political leader, especially of a progressive liberal party in 2017, and to live as a committed Christian, to hold faithfully to the Bible's teaching has felt impossible", Mr Farron said in a statement.
Farron said he will serve as leader until next month when the party will hold a leadership election.
That recovery was never inevitable but we have seen the doubling of our party membership, growth in council elections, our first parliamentary by-election win for more than a decade, and most recently our growth at the 2017 general election.
Swinson, who won her East Dunbartonshire seat from the Scottish National party, will be favourite to take the position unless a leadership challenger to Farron emerges. "There is still much more work needed to make ourselves more like the nation we seek to represent, but this is a really positive time for our party after increasing our number of MPs by 50%".