Jean defeats Apocalypse by engaging him on the astral plane as Phoenix.
Post credits: The Essex Corporation (Mister Sinister) recovers the Weapon X DNA from Stryker's lab.
In ancient Egypt, a mutant named En Sabah Nur, aka Apocalypse (Oscar Isaac) rules over the Egyptian empire. He is able to transfer from body to body to extend his lifespan and take on new mutant powers. The body transfer process leaves him susceptible to attack, so he has four mutant horsemen to act as his personal bodyguards. During one transfer (where he takes the body of a mutant with healing abilities similar to Wolverine), his temple is attacked and destroyed by Egyptian militants. Apocalypse is buried under tons of rubble and rendered unconscious.
Jumping centuries ahead, Magneto (Michael Fassbender), is living in a small town in Eastern Europe and started a new family. Charles Xavier, aka Professor X (James McAvoy), is running a school for mutants alongside Beast (Nicholas Hoult) who is building weapons in a secret lab in the event the X-Men ever reunite. Mystique (Jennifer Lawrence) is traveling the world to rescue abused mutants wherever she finds them. Meanwhile, CIA agent Moira MacTaggert (Rose Byrne), whose memories were wiped by Professor X at the end of First Class, is still a CIA agent, has married, and is investigating the cult pf En Sabah Nur. She is present when the cult manages to awaken and free Apocalypse. This forces Professor X to reestablish contact with her as he senses the vast and evil power of Apocalypse.
Meanwhile, Magneto is outed as a wanted mutant (due to the events in the last film). The local police go to arrest him and his family is accidentally killed by the police when his daughter manifests mutant powers. Magneto slaughters the town in anguish and flees. Mystique hears about Magneto's recent acts and visits Professor X to gain his help in finding and stopping Magneto. She brings along Nightcrawler (Kodi Smit-McPhee), a teleporting mutant she recently rescued. At the same time, another former X-Man Havok (Lucas Till) brings his younger brother Scott aka Cyclops (Tye Sheridan) to the school as Cyclops has manifested mutant powers of lasers shooting out of his eyes. They all meet student Jean Grey (Sophie Turner), a powerful mutant with little control over her telekinetic, telepathic and psychic abilities. While the group of heroes come together, Apocalypse recruits new horsemen and enhances their powers - weather-controlling Storm (Alexandra Shipp), psychic-powered swordswoman Psylocke (Olivia Munn), metal-winged mutant Angel (Ben Hardy) and Magneto.
Apocalypse senses Professor X's vast powers and attacks school where he successfully captures him. Beast's lab is blown up in the battle. Fortuitously, Quicksilver (Evan Peters), a mutant with super speed, arrives as the explosion occurs and is able to save everyone except Havok (who is killed in the blast). Quicksilver is Magneto's son from another relationship (though Magneto does not know this) and he had come to the school to seek Professor X's help in locating his father. The survivors are then incapacitated except for Nightcrawler, Jean, and Cyclops by Col. Stryker, who abduct Moira, Quicksilver, Mystique, and Beast in the belief they can help him find and kill Magneto. He takes them to the Weapon X base in Canada, not knowing that Jean, Cyclops and Nightcrawler have stowed away. The trio end up releasing a captured Wolverine (cameo by Hugh Jackman) who has been mind-wiped and made feral by Weapon X. Wolverine slaughters everyone at the base except for the heroes and Stryker (who manages to escape). The heroes then fly to Egypt to rescue Professor X.
Apocalypse reveals his plan to destroy the world and repopulate it with only the strong who survive. He tasks Magneto with ripping all the metal out of the world (which causes buildings, bridges, and virtually every other structure on Earth to begin collapsing). He then asks the other horsemen to protect him while he transfers his essence into Professor Xavier. If successful, he will gain Professor X's powers to control the minds of all the survivors, leaving him all-powerful. The X-Men arrive and begin fighting the Horsemen. Nightcrawler manages to reach Professor X and teleport him away before the transfer is complete (though the process to that point caused Professor X to lose all his hair). Meanwhile Mystique and Quicksilver implore Magneto to abandon his evil ways. Ultimately, the horsemen are defeated (with Magneto and Storm switching sides to join the X-Men). Apocalypse enters the fray and is only stopped when Jean manifests the Phoenix Force (a powerful, destructive force that she can tap into) and obliterates him.
The world is saved and Magneto is forgiven. Professor X recognizes the need for the X-Men and those who fought Apocalypse are made into his X-Men (including Storm). He also returns Moira's memories to her, realizing that wiping them was wrong. Magneto departs the school, wishing to avoid any further violence (and still does not know that Quicksilver is his son).
After the credits, a group of people break into the now-abandoned Weapon X facility. They steal a vial of Wolverine's blood that was left behind. It is then revealed that these people work for the Essex Corporation - implying that the next threat will be Nathaniel Essex, aka Mr. Sinister (an evil mutant geneticist).
Thanks Evan B (Long) and Herbmeistr (Pooper)!