The 19-year-old defender joined Rovers last month and has starred in their impressive start to the season, with three clean sheets in the opening five league games a key factor in Ronnie Moore's men storming into an early second place.
Gibson is a product of Boro's highly-regarded youth system and enjoyed spells with Plymouth and York last season. His new agreement means he will be available for Tranmere's home game with Coventry on Saturday.
"Ben has been fantastic for us since he arrived," said Moore. "He's vocal, he's a leader and he defends well.
"He's only young but he seems like he's been playing for years and I think he's got a very bright future ahead of him. He's settled in really well since he has been here and I'm delighted Tony Mowbray and Middlesbrough have agreed to extend his loan with us.
Gibson added: "I'm really happy to be staying. The lads and coaching staff have all been brilliant with me and the people behind the scenes have been fantastic. I've loved every minute of it."
- Ronnie Moore