First of all, I strongly suspect this question will a have a definitive answer four years from now. Michael Phelps has indicated in interviews that he will compete in London in the 2012 Olympics.
I do not think it is a stretch for one to envision Phelps winning another five or six gold medals (and maybe eight total medals again), which would give him 19 or 20 gold medals and many as 24 total medals. I cannot speak for the whole world (although I would like to), but this would end the discussion for me.
Although, admittedly, if longevity equaled greatness, then some would still argue for little-known (relatively speaking) Hungarian fencer Aladar Gerevich. All Gerevich did was win gold medals in six consecutive Olympics -- from 1932 until 1960 -- the last one at age 50 (all the more amazing since there was no Olympics in 1940 and 1944).
And let's not forget Milo of Croton (since this is an all-time question), a late sixth century BC wrestler who win five straight Olympic titles.
Right now, however, I think you can still have fun with this question even though comparing different sports, different generations, and different levels of amateurism and professionalism is even worse than comparing apple and oranges. Obviously some sports allow certain athletes to win more medals because of the multiple categories available within that particular sport. Swimming and gymnastics, and to a lesser extent, track and field (athletics), appear to have the most opportunities to win multi-events within a single Olympics.
Modern athletes are actually at a disadvantage because the competition is so much stiffer. Jim Thorpe (perhaps the greatest all-around athlete since 1900), Ray Ewry (eight gold medals in track and field in the early 1900's), Finnish distance runner Paavo Nurmi (nine golds, 12 total medals -- two of them 26 minutes apart!), Jesse Owens, and Soviet gymnast Larissa Latynina (nine golds, 18 total) are all great athletes, but did not face nearly as much competition as the the athletes in the 2008 Olympics did. And unlike Carl Lewis (nine golds, 10 total), Jesse Owens' Olympic career was interrupted by World War II.
Phelps makes money on endorsements and can continue his swimming career -- an option Mark Spitz (seven golds, nine total) did not have in 1972. Both Thorpe's and Nurmi's careers were cut short due to accusations of professionalism. Hence, while Phelps might (most golds -- Latynina still has most total medals) be the most decorated Summer Olympian, he has had some advantages (and perhaps more importantly, no disadvantages) that other athletes did not have.
Here are some more athletes for you to consider for great Summer Olympians: Two-time decathlon winners Bob Mathias and Daley Thompson, British rower Steve Redgrave (gold medals in five straight Olympics), Soviet gymnast Nikolay Andrianov (seven golds, 15 total), Al Oerter (four straight discus golds -- all Olympic records), and Jackie Joyner-Kersee (two golds and one silver in heptathlon).
So far we have just looked at the greatest Summer Olympians based on their Olympic accomplishments, however (to give you an interesting twist), that does make them the BEST ATHLETES who won gold medals in the Summer Olympics.
Besides Thorpe (he also played professional American football and baseball), those awards would go to Michael Jordan (two golds) and Muhammad Ali (A.K.A. Cassius Clay in 1960 when he dazzled people while winning the 1960 Olympic light-heavyweight gold medal at only 18 years old).
I realize they are all Americans, however, it is not my fault Pele did not ever have a chance to compete in the Olympics. While I consider Jordan to the greatest athlete ever (OK, since 1900) -- I can make a good argument for Pele: the best player of all-time in the world's most popular sport -- a pretty impressive combination of factors. Let the debates begin!