The 25-year-old Brazil international joined Arsenal in 2019 and went on to make 278 appearances for the club in all competitions, scoring 62 goals.
Martinelli played an important role during his time in north London, helping Arsenal win the Premier League last season, as well as the FA Cup in 2020 and the FA Community Shield in 2023.
Al Hilal confirmed that Martinelli has signed a four-year contract as the club continue to strengthen their squad with established players from European football.
Arsenal thanked the forward for his contribution after his departure was confirmed.
"Everyone at Arsenal would like to thank Gabi for his contribution to the club and wish him and his family well for the future," the Premier League champions said.
Martinelli becomes the latest Premier League player to join Al Hilal this year, following Crysencio Summerville from West Ham United and Ollie Watkins from Aston Villa.