The 24-year-old is the latest player to agree fresh terms at Kingsholm following recent deals for England centre Billy Twelvetrees and full-back Rob Cook.
Swindon -born Trinder has spent his entire career with the Aviva Premiership club, having developed through their academy system.
"We are very pleased," Gloucester rugby director Nigel Davies said.
"Henry can form a formidable midfield partnership with Billy Twelvetrees which, moving forward, will underpin Gloucester.
"He has been in superb form so far this season, and I firmly believe he will only get better."
Trinder added: "I am very happy to get it all done.
"It's been a busy last month or so with the England call-up, so it's great to get it all out of the way so that I can focus on my rugby.
"Kingsholm is a fantastic place to play rugby, and after I spoke with Nigel and he outlined where he's hoping to take the club in the future, I wanted to be part of that."
- Sports & Recreation
- Billy Twelvetrees
- Nigel Davies
- Gloucester rugby