Gil has agreed a contract until 2026 with the north London club.
The 20-year-old winger will link up with his new teammates at the Tottenham Hotspur Stadium following the conclusion of the football tournament at the Tokyo Olympics, where he is representing Spain.
This transfer agreement ends Lamela's eight-year stint at Spurs.
The 29-year-old Argentinian joined from Roma in August 2013 and made 257 appearances in all competitions.
"A club man through and through, we wish Erik all the best for the future," said Spurs in a statement on their website.