He joins the Bundesliga champions after four seasons with Rennes.
While financial details were not disclosed, German media reported that the deal was worth around 22 million euros (£18.5m). Terrier has made a combined 202 league appearances for Lille, Strasbourg, Lyon and Rennes, scoring 60 goals and making 24 assists.
"It's been my wish to move to a big club abroad in Europe after seven years as a professional in France," Terrier told the club website late on Thursday.
"The fact I now get to show my skills with the German double winners is magnificent and a special motivation for me."
Coach Xabi Alonso's side have also signed midfielder Aleix Garcia from Spanish side Girona with the 26-year-old signing a five-year deal.