The play is divided in two parts, consisting of two acts each.
Act 1
In the opening scene, set during the epilogue of Deathly Hallows in the year 2017, Harry and Ginny Potter send their younger son, Albus Severus, on the Hogwarts Express to begin his first year at Hogwarts. Harry works a desk job as the Head of Magical Law Enforcement at the Ministry of Magic, while Ginny is the editor of the sports section of The Daily Prophet. Ron Weasley and Hermione Granger also send their daughter Rose on the train. Hermione is now Minister for Magic, while Ron manages Weasley's Wizard Wheezes in Diagon Alley alongside his older brother George. On his first trip aboard the Hogwarts Express, Albus forms an unlikely friendship with Scorpius Malfoy, the son of Harry's former nemesis Draco and his wife Astoria (née Greengrass). Unlike his father, Scorpius is very polite and very nerdy. The school is stunned when, in a break with the tradition of Potters being sorted into Gryffindor, Albus is sorted into Slytherin alongside Scorpius.
Both boys are bullied by other students over the next few years, Albus due to his perceived failure to live up to his parents, and Scorpius due to unproven rumours that he is the son of Lord Voldemort. Astoria then passes away due to a fatal disease. Albus and Harry drift apart due to Albus's struggles with his father's shadow and Harry's uncertainty on how to deal with his son's problems. Albus also drifts apart from Rose, with whom he was close before meeting Scorpius. The summer before his fourth year, Albus gets into a fight with his father after being given the latter's baby blanket and a love potion from Ron. During the fight, Harry angrily says that he sometimes wishes Albus was not his son, and Albus spills the potion on the blanket.
Harry obtains a prototype of a more powerful version of the Time-Turner that allows one to travel into the past and change history. Simultaneously, Harry's scar starts hurting again, causing him to become concerned that Voldemort may be returning. Amos Diggory, who has become old and is cared for by his niece Delphi, asks Harry to use the Time-Turner to prevent the death of his son, Cedric. After overhearing Harry refuse to help the Diggorys, Albus is inspired to do so and convinces Scorpius to help him. The two escape from the Hogwarts Express to visit Amos, and they team up with Delphi to steal the Time-Turner from Hermione's office, in the Ministry of Magic, while disguised with Polyjuice Potion.
Act 2
Knowing that Cedric's death was the result of him winning the Triwizard Tournament alongside Harry, the boys use the Time-Turner to travel back to the first tournament challenge in 1994. The two disguise themselves as Durmstrang students in an attempt to sabotage Cedric to prevent his victory. The plan fails, and the disguises cause Hermione to become suspicious of Viktor Krum, a Durmstrang student, and go to the Yule Ball with Ron instead. As a result, Ron never experiences the jealousy fundamental to his relationship with Hermione, and the two never marry. Ron instead falls in love with Padma Patil at the Ball, and Hermione becomes a frustrated and mean professor at Hogwarts, teaching Defence Against the Dark Arts.
Meanwhile, Harry has nightmares about Voldemort as he grows suspicious that the wizard will return. A centaur named Bane tells Harry that a "dark cloud" is around Albus. Convinced that Scorpius is a threat to Albus, Harry tries to have the boys kept apart at Hogwarts by attempting to force Headmistress Minerva McGonagall to keep tabs on Albus using the Marauder's Map.
Albus and Scorpius' friendship is destroyed, but the two eventually reconcile after Albus steals Harry's old Invisibility Cloak from Albus's older brother James Sirius. Harry is persuaded to relent after a conversation with Draco and Ginny. Meanwhile, Albus and Scorpius make another attempt to use the Time-Turner to change Cedric's fate, this time by humiliating him during the Triwizard Tournament's second task. When Scorpius returns to the present day, however, Albus is not with him. Dolores Umbridge walks up to him and reveals that Harry is dead and Lord Voldemort rules the wizarding world.
Act 3
Scorpius discovers that as a result of his actions, Cedric joined the Death Eaters and killed Neville Longbottom, preventing him from killing Nagini and allowing Voldemort to win the Battle of Hogwarts. With Harry now dead, Albus never existed, while Voldemort was able to completely consolidate power and transform the Ministry of Magic into a dictatorial regime. In the new timeline, Scorpius became a popular Head Boy and Quidditch star, helping the staff and students torment Muggle-borns. Umbridge became the new Headmistress of Hogwarts and patrols the school with Dementors and a revived Inquisitorial Squad led by Scorpius.
A powerful dark figure called "The Augurey" leads the Ministry of Magic. With help from Ron, Hermione, and Severus Snape, now the final members of a dwindling anti-Voldemort resistance movement, Scorpius is able to use the Time-Turner to prevent the interference of Albus and his past self and restore the events of the original timeline, the alternate Ron, Hermione, and Snape sacrificing themselves to the Dementors in order to allow him to do so. Scorpius reunites with Albus, and the two boys are eventually found by their parents, as well as Ron and Hermione. Following these events, Harry scolds Albus for his actions, but the two nevertheless begin to reconcile.
Realising the danger the Time-Turner poses, Scorpius and Albus attempt to destroy it themselves, but they are joined by Delphi. Scorpius notices that Delphi has a tattoo of an Augurey and realizes she was in charge of the Ministry of Magic in the alternate timeline. Delphi takes them captive, killing a fellow student in the process, and reveals her intention of restoring the alternate timeline.
After Ron reveals he saw Albus and Scorpius with Delphi while he was in Hogsmeade with Neville, Harry and Draco confront Amos, only to discover Delphi had bewitched him into thinking she was his niece. Delphi takes the boys to the final challenge of the Triwizard Tournament, but Albus and Scorpius prevent her from acting, and Delphi uses the Time-Turner again to travel farther back in time. She inadvertently takes the boys with her and then destroys the Time-Turner to leave them stranded in time.
Searching Delphi's room, Harry, Draco, Ginny, Hermione, and Ron discover hidden writing on the walls describing a prophecy that will allow Voldemort to return. Draco questions why she would be so obsessed with Voldemort's return, as Ginny finds writing on the ceiling that claims Delphi is the daughter of Voldemort.
Act 4
Albus and Scorpius discover they have been taken back to the night before Harry's parents were killed and assume Delphi is planning to kill Harry before Voldemort attempts to do so. Albus and Scorpius write an invisible message on Harry's baby blanket, knowing in the present, the blanket would become stained with a love potion and expose the message. The message reads: "Dad.Help.Godric's Hollow.31/10/1981."
Meanwhile, Draco reveals the Time-Turner was actually a prototype for a perfected model owned by him, but they remain unable to rescue the boys due to their uncertainty over which time period they have entered. After Harry receives the message from the boys, he and his allies use Draco's Time-Turner to travel back in time to save them and stop Delphi. While waiting for Delphi, they deduce she intends to convince Voldemort to abandon his doomed attempt to kill Harry, ensuring her father's survival and allowing her to be with him.
Harry disguises himself as Voldemort using Transfiguration to distract Delphi; after a struggle, the group manages to subdue her. Rather than killing Delphi, it is decided that she will be given a life sentence in Azkaban Prison. Lord Voldemort then appears and is oblivious to the presence of Harry and the group. The group allows the murder of Harry's parents to play out again, unwilling to risk the consequences of altering the past.
After returning to the present day, Delphi is sent to Azkaban. Albus and Scorpius now decide to be more active at Hogwarts, with Scorpius expressing interest in trying out for the Slytherin Quidditch Team and asking Rose out on a date. Harry and Albus visit Cedric's grave, with Harry apologizing for his role in Cedric's death.