After you beat the 7th Gym, you'll need to get the HM for Dive. AFter you get this HM, you must find a secret underground cavern in the water (The underwater entrance to the cavern looks almost the exact same as the underwater entrance to Sootopolis, so it stands out fairly well).
Once you get in there, traverse through the cavern, and battle Archie for a second time. After the battle, watch Archie awaken Kyogre.
When this happens, you go to Sootopolis. The Gym Leader, Wallace, will direct you to the Cave of Origins. Go inside of the Cave of Origins, and you'll square off against Kyogre itself (Lv. 45, and sky high HP and Special Attack. It's a tough fight, so be careful).
After you KO Kyogre (or catch it!), you can leave the cave, and challenge the last gym without any delays! It's a fairly easy gym, since it's a bunch of mediocre water-types (Goldeen, Spheal, Barboach, etc.).
Hope I helped!