Shmini Atzeret should really have been placed seven weeks after Sukkot as Shavuot, the "closure" of Pesach, follows it by seven weeks, but, according to the Midrash, Hashem had mercy on the Jewish People. For Pesach is in the Spring and Shavuot is in the Summer, both pleasant times for travel (these holidays are all "Regalim," Pilgrim Festivals, on which Jewish males are obligated to travel to the Temple in Yerushalayim), but seven weeks after Sukkot would already be into the rainy season in Israel, and travel would not be pleasant then. Therefore, Hashem allowed the closure of Sukkot, Shmini Atzeret, to be celebrated right after Sukkot.
Further evidence that Shmini Atzeret is the closure of Sukkot is provided by the Midrash's interpretation of the sacrifices brought on the two holidays.
Over the course of the seven days of Sukkot, seventy bulls are brought, beginning with thirteen on the first day and seven on the last. These are interpreted as being for the benefit of all the nations of the world.
But on Shmini Atzeret, G-d says to the Jewish People, "All the guests have gone home now. Stay with me yet another day, and we will celebrate together, just you and I."