The 19-year-old has been in great form for the Addicks and manager Lee Bowyer was keen to keep hold of him until the end of the season.
Gallagher, though, has chosen to reunite with Swans boss Steve Cooper, under whom he won the Under-17 World Cup in 2017.
Cooper's side are currently sixth in the Championship and on track for a place in the play-offs while Charlton have been increasingly sucked towards the relegation zone having recorded just one win from their last 11 games.
Bowyer spoke of his disappointment after seeing his loanee, who scored six goals and laid on three assists in 26 games for the Addicks, depart during the middle of their season after having had positive feedback from the Blues' loan coaches.
"I’m disappointed," Bowyer said in a brief statement. "I didn’t see this coming if I’m honest which makes it harder to take. He’s a great talent to work with and I wish him all the best for his future."
As well as Cooper, Gallagher will also be reunited with two of his team-mates from the World Cup win in India, with Marc Guehi and Rhian Brewster having already moved to the Liberty Stadium on loan this month.
Guehi joined Swansea last week in a six-month loan deal with an option to extend it for a further season, and Goal has learned that Gallagher will have a similar option included within his own deal.
Liverpool youngster Brewster, who made his debut against Cardiff City on Sunday, also has a personal connection with Gallagher having begun his career at Chelsea's academy before being released and signed by Liverpool.
Gallagher is highly regarded at Stamford Bridge and is seen as a candidate to follow in the footsteps of Tammy Abraham, Mason Mount and Fikayo Tomori in graduating to the first-team in west London.
He is unlikely to be the last Chelsea player to see their loan agreement changed during the January window, with Ike Ugbo having received offers to switch his loan from Roda JC to a bigger club.
Fortuna Dusseldorf loanee Lewis Baker is also a candidate to change clubs after falling out of favour with manager Friedhelm Funkel.