Stolarz grew up playing youth hockey in New Jersey. He played in the 2007 Quebec International Pee-Wee Hockey Tournament with the New Jersey Devilsminor ice hockey team. During the 2010–11 season, he played for the New Jersey Hitmen of the Empire Junior Hockey League. Stolarz was left at a crossroads after the end of the season when he was cut by the team. He moved to Texas to play with the Corpus Christi IceRays of the North American Hockey League after earning a spot with the team at an open camp. Stolarz's draft stock rose after his successful 2011–12 season with the IceRays, and he finished the season ranked fourth amongst North American goaltenders in the NHL Central Scouting Service's final rankings. He was the only NAHL player to be invited to the 2012 NHL Draft Combine. The Philadelphia Flyers selected Stolarz with their second-round pick, 45th overall, in the 2012 NHL Entry Draft. Following his season with the IceRays, Stolarz accepted a hockey scholarship from University of Nebraska-Omaha to play with the Mavericks. He began the 2012–13 season with the team, but after playing eight games, he dropped out to join the London Knights of the Ontario Hockey League. In a regular season game against the Saginaw Spirit on January 17, 2014, Stolarz was accidentally cut on the back of the leg by the skate blade of Spirit captain Eric Locke during a shoving match in front of the net between Locke and Knights defenseman Dakota Mermis. Stolarz was attended by team doctors on the ice before being removed on a stretcher and taken to a hospital. It required 55 stitches to close the wound. Stolarz returned to the Knights lineup after nearly two months of recovery. Stolarz played 55 regular season games over the two seasons he spent with the Knights as well as being their starting goaltender for the Memorial Cup both seasons.
Professional
Stolarz signed a three-year, entry-level contract with the Philadelphia Flyers on March 1, 2013. He made his NHL debut on November 27, 2016, against the Calgary Flames, earning his first NHL win with a 5–3 win. Stolarz made the Flyers opening night roster for the 2018–19 season. He was loaned to the Lehigh Valley Phantoms of the American Hockey League on October 6, but was recalled to the NHL on November 23. He was placed on injured reserve on December 17 due to a lower body injury. On February 15, 2019, Stolarz was traded by the Flyers to the Edmonton Oilers in exchange for goaltender Cam Talbot. Stolarz made his first start for the Oilers on March 9, 2019 against the Toronto Maple Leafs. On July 2, 2019, Stolarz agreed to a two-year, $1.5 million contract as a free agent with the Anaheim Ducks.