Farron said he is unable to continue because he is too torn between his Christian faith and his duties as a political leader.
Farron, a Christian, previously appeared to state that gay sex was a sin, and also faced tough scrutiny of his views on abortion after previously claiming it was "wrong".
"To be a leader, particularly of a progressive liberal party in 2017 and to live as a committed Christian and to hold faithful to the Bible's teaching has felt impossible for me". "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%".
The Liberal Democrats managed just 12 seats on June 8, despite uncertainty in a post-Brexit Britain.
But he added that his faith as Christian, for which he had been heavily questioned, was the root cause of his resignation.
He said he had been torn between his religion and serving as a political leader.More news: Trump's attorney general to testify in public on Russian Federation
More news: London Bridge attacker tried to rent larger truck
More news: Kimi Raikkonen fastest in 2nd practice at Canadian GP
He said the focus on his faith had been a distraction.
'Journalists have every right to ask what they see fit.
He said he was passionate about defending the rights and liberties of people who believed differently to him, but said he had been the "subject of suspicion" because of his own beliefs.
There are Christians in politics who take the view that they should impose the tenets of faith on society, but I have not taken that approach because I disagree with it - it's not liberal and it is counterproductive when it comes to advancing the gospel.
I intend to serve until the parliamentary recess begins next month, at which point there will be a leadership election according to the party's rules.
Commenting on Mr Farron's decision, his predecessor and ex-deputy prime minister Nick Clegg said: "This must have been an agonising decision given Tim's lifelong dedication to the Liberal Democrats". These are odd times in United Kingdom politics.
"But I wanted to revive the role as it gives the party another powerful voice".