Economic impact is quite a hard quantity to measure chiefly because the impact can last over a very long period and be observed in many indirect forms.
Immediate cost or balance sheet overview
The immediate cost or a balance sheet overview can be simply compiled by counting the investment made in stadia, athlete accommodation, security arrangements, and other infrastructure investments (if applicable), and counting ticket revenues, tourist spending around the event (counting till those tourists make the final exit), money inflow from infrastructure improvements etc. Sometimes such figures can be disappointing but if a city is suffering from a low revenue they can look good too. Montreal 1976 remains, the worst Olympic event for a host city (financially) --the net debt was around $1.5 billion and was finally paid off in 2006. Athens 2004 was also run at a net loss. Beijing, Los Angeles and Seoul were a net financial success (although reliable estimates for Beijing games are not publicly available).
Edit: I just noticed that you had also asked for chief reasons of success/failure. Here they follow:
Montreal (1976): The stadium itself was the biggest investment. Still unfinished by the time Olympics began the stadium's cost were not matched by the revenue it was supposed to generate. Till date, the stadium does not have a long term tenant. For sources please see wikipedia (it cites sources). The biggest contributor to the loss was that in those days Olympics had to be publicly sponsored. Private sponsorship and investment followed in 1980s --as a result of the Montreal lesson.
Athens (2004): The document I have cited for Athens details the investments, cost projections, and revenue projections. Many of the hotels built for the event remain grossly under-occupied.
Los Angeles (1984): This remains one of the most financially successful Olympics of modern times. Two chief ways in which LA was able to avoid what happened to Montreal were private funding through corporate sponsoring and higher TV broadcast revenues. The latter was probably why corporate sponsors became interested. This wikipedia article sums it up quite beautifully:
While Montreal organizers ran up a substantial debt eight years
earlier by constructing many new, overly ambitiously designed venues,
the Los Angeles Olympic Organizing Committee relied heavily on the use
of area venues that were already in existence, particularly Los
Angeles Memorial Coliseum, which was also the Olympic Stadium for the
1932 Summer Olympics. The Olympic Velodrome and the Olympic Swim
Stadium, funded largely by the 7-Eleven and McDonald's corporations
respectively, were the only two new venues constructed specifically
for the L.A. Games. The resulting low construction costs, coupled with
a heavy reliance on private corporate funding, allowed the Games to
generate a profit of more than $200 million, making them by far the
most financially successful in history.
In addition to corporate support, the Olympic committee also made use
of the burgeoning prices being paid for exclusive television rights.
Starting with the Los Angeles Games, these contracts would be a
significant source of revenue. Adjusted for inflation, the Los Angeles
Games received twice the amount received by the 1980 Moscow Summer
Olympics and four times that of the 1976 Montreal Summer Olympics.
Seoul: Seoul in 1988 earned mainly through sale of TV broadcasting rights (₩224,694 million) and marketing (₩70,833 million). Commemorative coins, lotteries, and admission tickets also added to the revenue significantly. These figures are broken down in considerable detail in the Vol. 1 of the official report published by Seoul Olympic Organization Committee. Please see section 7 (in particular 7.1.2, 7.1.3, and the balance sheet on page 211) of that report for more details.
Beijing: Beijing 2008 games remain much of a mystery. A detailed financial report is not included in the final report (three volumes) published by the Beijing Organizing Committee for the Games (BOCOG). However, that report does mention a dedicated investment fund that raised $40 million in interest and RMB-USD exchange rate pegging that averted losses to organisers from exchange rate fluctuations (thereby encouraging more investment). The report also details tax breaks and debt extension schemes introduced to encourage more investment in the games. For full details please see Chapter 5 (Finances) of Vol. 3.
It should be noted, for Beijing, though that the last two measurements do cost the exchequer and although these costs are external to the games they should be counted as proper costs because they were incurred because of the games. However, if you start doing that then you must also count the external benefits of incurring those costs in other areas --and that is why a thorough analysis with externalities is what can be more accurate guide to the real cost of such games.
Disclaimer on the magnitude of these costs
One thing should be mentioned in this context. The cost of these events may look huge to us --£12 billion for the London Olympics is no doubt a huge amount for us or most corporations indeed. But considering that these countries have annual GDPs of trillions of dollars, £12 billion is like a drop in that ocean (ok, a bucket in the ocean).
Long term benefits or counting with externalities
The usual political argument given by those in favour of hosting such big events (Soccer, Rugby, or Cricket world cups, Commonwealth games, Asiad, or Olympics etc.) are that they can make a city global, project its economic might, or spur investment in infrastructure. For proponents who attempt to bring these events to a developing country/non-global city the argument is to project the city as a global centre open for business or tourism. For cities that are already a global centre of business and tourism one of the many projected intentions is to spur investment in infrastructure (notable example, New Delhi for Commonwealth games and more recently London for 2012 Olympics). These events can create jobs in the construction and tourism sector too.
P.S: I am analysing vast amount of World Bank data concerning GDP, infrastructure metrics, tourism, foreign investment, exports/imports, inflation, and national debt. At the end of this analysis (may well take weeks) I should have something to add to this section. In the meanwhile, I hope I have answered your current question.