Mr Videgaray was seen as the main organiser of the controversial meeting between Mr Trump and President Enrique Pena Nieto.
The visit was widely criticised by Mexicans both in the national press and on social media.
A spokesperson for the ministry said Mr Videgaray would not take on another public office.
He will be replaced by the current Minister of Social Development, Jose Antonio Meade. Mr Meade previously held the finance portfolio in 2011 and 2012.
Mr Trump, the Republican nominee for the US presidency, visited Mexico briefly on 1 September, despite widespread condemnation of some of his earlier comments about Mexican migrants to the United States.
He had called Mexican migrants "criminals" and "rapists". Such remarks led President Pena Nieto to compare the American to Italian fascist leader Mussolini, and Adolf Hitler.
Mr Videgaray has been one of the president's closest advisers, orchestrating a successful election campaign in 2012.
However, Mr Trump's visit almost immediately caused public relations problems, when he appeared later that day at a rally in Arizona.
There, he told the crowd Mexico would "100%" pay for a planned border wall, though he told reporters he had not discussed the issue with President Pena Nieto.
The president later insisted he had told Mr Trump that Mexico would not pay.
In 2014, Mr Videgaray came under fire when a newspaper investigation revealed he had bought his home from a construction firm whose parent company had won major public contracts.
He denied any wrongdoing or conflict of interest.
President Pena Nieto said the new minister will "apply adjustments to public spending" but there will not be any rise in taxes.

Leanne Wood made the comments in a BBC TV debate, which took place a day after the terrorist attack in London.
Ms Wood also said that she would like to see the highest tax rate raised from 45% to 50%.
She said she would be willing to put up taxes to fund public services.
Referring to the prime minister's speech in the wake of the attack, where she said there had been "far too much tolerance of extremism in our country", Ms Wood pointed to the fact that Mrs May had been home secretary for six years prior to being prime minister.
"Since 2010 she has been in a position to do something about this," she said.
"And if we have been too soft on extremists as she claims, then doesn't she need to take some responsibility for that?"
Speaking on Election Questions on BBC One, Ms Wood said Plaid "would be open to a discussion" about putting income tax up for higher earners in Wales, once powers are devolved.
"For those who can afford to pay the most we would," she said.
Pushed on the subject again if, "in principle", she would put tax up in such a way, she said: "For the additional rate of income tax people who currently pay 45%, we would like to see that go up to 50%.
"That would bring in a British context Â£3bn extra to spend on public services."
But she qualified that by adding: "When income tax comes to Wales we will be having a different conversation."
Income tax varying powers could devolved to the assembly from 2019.
Asked if it would be the time to trigger a campaign for independence if there was a "very hard Brexit", she said: "It may well be".
"If that final deal is going to be very bad for Wales then we need to consider all options at that time," she said.

Lines, 47, followed up a 3-0 win over the Scot with a 4-0 defeat of England's 1991 world champion John Parrott.
The event in Scunthorpe offers the winner a place in the World Championship qualifying event.
Now aged 48, Hendry retired after being knocked out of the 2012 World Championship.
"I didn't play well. It feels like somebody else's arm out there," he said after losing to Lines.

A 17-year-old female passenger is in a critical but stable condition in Ninewells Hospital following the crash on Camperdown Park's, Main Drive.
The 17-year-old female driver off the red Ford Ka and a 19-year-old male passenger sustained minor injuries.
The incident happened at about 22:10 on Wednesday.
Police Scotland has appealed for information from anyone who witnessed the crash or who was in the area at the time.
Mexican Finance Minister Luis Videgaray has resigned following the visit of Donald Trump last week.
[NEXT_CONCEPT]
Theresa May should take responsibility if Britain has been too soft on extremists, the leader of Plaid Cymru has said.
[NEXT_CONCEPT]
Peter Lines defeated seven-time world champion Stephen Hendry in the semi-finals on his way to winning the World Seniors Championship.
[NEXT_CONCEPT]
Three teenagers have been injured, one seriously, after a car they were travelling in collided with a tree in a Dundee park.