The sum fell short of the 50,000 euros Gayet had demanded when she filed the suit shortly after Closer set off a political earthquake in January by publishing photos of Hollande, 59, and the actress, 41, arriving separately at a Paris apartment for alleged trysts.
The court in the Paris suburb of Nanterre also ordered the magazine to publish the full ruling on its front page.
Hollande split with longtime partner Valerie Trierweiler, 49, following the scandal but has refused to comment further on his private life or the nature of his relationship with Gayet.
"She was assaulted by swarms of photographers... It was like the hunt of a wild animal," he said.
Also Read
Closer's lawyer Delphine Pando told the court the magazine was justified in publishing the photographs.
She said they were in the public interest because they raised questions about presidential security and Hollande's "duty of transparency".
As well as the civil suit, Gayet has filed two other criminal complaints: one for breach of privacy over separate photos published by Closer of her taken inside a car, which under French law qualifies as a private space; and another accusing paparazzi of "endangering others" by allegedly hounding her.
During a rare public appearance in New York this month she fended off questions about her relationship with Hollande, telling a reporter: "My private life is my private life.