The stadium will host 54,000 spectators, and will be a UEFA category 4 venue.
"Through this deal with West Ham United FC, we are defying the gloomsters who predicted this landmark would become a dusty relic," London Mayor Boris Johnson said.
Work on converting the stadium for football use will begin in autumn and should be finished within two years. It is likely to be one of the key venues at the 2015 Rugby World Cup, with West Ham then kicking off at their new ground for the first time in August 2016.
Johnson said conversion work could possibly be staggered to allow the stadium to host those rugby matches.
"We are looking with great interest at the rugby World Cup in 2015. It would be great if we could make that work," he said.
The stadium will also host the 2017 World Athletics Championships, as the running track will remain.
In a joint statement club chairmen David Sullivan and David Gold said: "It's fantastic for everyone at West Ham United that at last all the club's hard work over the past three years has paid off. Since we came to West Ham in 2010 we have had a vision to really take the club forward so West Ham United can compete on the pitch at the highest level.
"Today's decision offers us a real platform to do this and we are fully committed to making it a real success. We understand the responsibilities that come with calling the nation's iconic Olympic Stadium, which will be converted into a world-class football stadium, our new home. It is an honour we will take on with pride.''
The final agreement reportedly came only when the government pledged a further £25 million of public money towards the costs of converting the venue for football use.
That means the taxpayer will be contributing £60m of the estimated £170m cost of re-purposing the stadium, which will include extending the roof and adding retractable seating to cover the running track.
Premier League side West Ham will cover just £15m of those costs, with the remainder being either provided or borrowed from the London Mayoral budget, Newham Council and London Legacy Development Corporation.
In addition, the side will pay £2m a year rent. That equates to just under half the annual running costs, though the LLDC will take a share of hospitality and catering profits.
West Ham have signed a 99-year agreement that will make them the main tenant of the stadium, which is only around three miles from the smaller Boleyn Ground - also known as Upton Park - where they have played for more than a century.
The Hammers were named preferred bidders three months ago, but continuing legal challenges from rivals - notably Barry Hearn's on behalf of Leyton Orient - and wrangling over who will foot the bill for the necessary work had put the deal in jeopardy.
Leyton Orient are said to still be pursuing a judicial review of the bidding process, but the LLDC are reportedly "confident" that the process will not be delayed.
"The LLDC have made a massive, massive mistake," Hearn told Press Association Sport. "They are my lawyer's words and not mine, in as far as they have ignored their own rules so we are going to challenge that with a judicial review in the High Court.
"What does the world legacy really mean? I hear the word from politicians all the time and I don't think they can even spell the word.
"It is just a game. Well we are not in a game, we are in a fight for survival and we have to do everything available to us to continue the fight."
Former sports minister Richard Caborn called the West Ham deal "the biggest mistake of the Olympics".
"West Ham are basically getting a stadium costing more than £600m pounds for just £15m and a small amount in annual rent," he said.
Johnson defended the deal, saying it was a good investment for the taxpayer.
"It will deliver long-term revenues, and it will also help to regenerate part of east London and create thousands and thousands of jobs," he said.
The LLDC has also ensured that the taxpayer benefits from any increase in value of the club if Gold and Sullivan were to decide to sell it within the next 10 years.
The owners said they were committed to a club they bought in 2010. They see a larger stadium as a chance for West Ham, promoted last season, to compete with the top clubs in the Premier League.
"Our intention is to be at this football club until we die," said David Gold. "There is every possibility that we will hand over ownership of this great football club to our children."