Gomez became a free agent when his contract was bought out by the Montreal Canadiens earlier this month. He's been skating and traveling with the Sharks since last week.
In 196 games with the Canadiens, Gomez had 21 goals and 87 assists.
The deal reunites Gomez with Sharks assistant coach Larry Robinson, who coached him for parts of his 4 seasons with the New Jersey Devils.
Gomez is expected to center the 3rd line with the Sharks.