The former England captain joined Milan on a two-month loan from the Los Angeles Galaxy in January and was due to return to the Major League Soccer club next week.
But Beckham wants to stay in Italy, and Galliani said the two sides are close to a deal that would keep him at Milan until the summer.
"The deal is getting more and more concrete," Galliani told the club's TV station. "I hope we can arrange it so he stays on loan at least until June 30. Then he could return to Los Angeles and rejoin us in January."
"The deal is not done. We're working on the possibility of a loan until June 30, but no deal has been reached yet," Galliani said before boarding a plane for Doha, Qatar.
Financial terms of the proposal are unknown, but the Galaxy earlier had asked for $10 million from Milan for the outright purchase of Beckham. Milan had said it would pay no more than $3 million, since he could become available anyway after the MLS season.
"This is the direction we're aiming for," Galliani said. "It's complicated, as we've always known, but I'm still trying."
Beckham wants to remain with Milan to improve his chances of making England's squad for next year's World Cup. He has played in 11 games with the Rossoneri, nine of them in Serie A in which he always started.
"He's transformed himself into a very important player, although he's a bit worn down right now," Galliani added