Gosling, 27, joined Bournemouth from Newcastle United in the summer of 2014, and has scored nine times in 61 appearances for the Cherries over the last two campaigns.
The midfielder's previous deal was due to expire next summer, and he has revealed his delight at penning fresh terms.
"I've really enjoyed my three years here. It's gone so fast but I believe I've improved immensely, working with the manager and his coaching staff," Gosling told Bournemouth's official website.
"In that time we have gained promotion and spent two years in the Premier League, so it couldn't have gone any better. My goal now is to be a mainstay in the side and keep adding to my game."
Meanwhile, Bournemouth boss Eddie Howe added: "I am delighted Dan has signed a new contract as he is a very important part of our squad and what we are trying to achieve here.
"He has great talent, huge energy and offers real quality to our midfield. Despite only being 27, Dan also has plenty of Premier League experience and that is crucial for a team that is still relatively new to the division."
Gosling scored twice in 27 Premier League appearances last season.