The 18-year-old has made 19 senior appearances this season after making his debut against Sunderland in the Capital One Cup against Sunderland in November and has now committed to the south coast outfit until 2018.
Gallagher scored his first goal for the club in the FA Cup win over Yeovil and added to that with a league strike against Norwich at St Mary's in March.
"It's been a big year for me and this just tops it off really," he told the club's official website.
"I'm very happy and very proud
I won't forget this day."
He added: "I'm still getting a lot of experience, even from training and being around everyone.
"Now it'll be good to see how I push on next season
I'm looking forward to pre-season because it's my first one with the first team.
"I don't really know what to expect, but I've seen pictures from last year so I know it's going to be tough.
"I know I'm going to have to work hard, but hopefully it will all pay off."
Source : PA
Source: PA