The Spanish midfielder will officially complete his switch to the Stadium of Light on July 1, ending a five-year spell with the Latics.
Gomez originally moved to England from Espanyol in 2008, impressing on a loan spell at Swansea, and was quickly snapped up by Wigan.
During his stay at the DW Stadium, he helped the club to lift the FA Cup in 2013 and scored 11 goals in his last campaign at the club, earning the Player of the Year award.
But Gomez will return to the Premier League with Sunderland as manager Gus Poyet continues his summer strengthening.
Poyet has also completed a deal for full-back Billy Jones, who joins from West Brom.