In a BBC interview, Aisha Buhari suggested his government had been hijacked by only a "few people", who were behind presidential appointments.
She said the president did not know most of the officials he had appointed.
Mr Buhari, who is on a visit to Germany, has responded by saying his wife belonged in his kitchen.
Standing alongside German Chancellor Angela Merkel at a news conference, the president laughed off his wife's accusations.
"I don't know which party my wife belongs to, but she belongs to my kitchen and my living room and the other room," he said.
The remarks earned him a glare from Chancellor Merkel.
Mr Buhari said that having run for president three times and having succeeded the fourth, he could "claim superior knowledge over her".
Mr Buhari was elected last year with a promise to tackle corruption and nepotism in government.
But in the interview with Naziru Mikailu from BBC Hausa, Mrs Buhari said: "The president does not know 45 out of 50 of the people he appointed and I don't know them either, despite being his wife of 27 years."
She said people who did not share the vision of the ruling All Progressives Congress (APC) were now appointed to top posts because of the influence a "few people" wield.
"Some people are sitting down in their homes folding their arms only for them to be called to come and head an agency or a ministerial position," she said.
His wife's decision to go public with her concerns will shock many people, but it shows the level of discontent with the president's leadership, says the BBC's Naziru Mikailu in the capital, Abuja.
Aisha Buhari campaigned vigorously for her husband in last year's election in Nigeria, organising town hall meetings with women's groups and youth organisations across the country.
However, she kept a low profile at the start of the administration and was barely seen or heard. She was restricted to her work on the empowerment of women and helping victims of the Boko Haram conflict in the north-east of the country where she is from. This is one of the reasons why this damning interview has caught the attention of many Nigerians.
It is a significant blow for Mr Buhari, who has a reputation for being a tough, no-nonsense president.
Her comments also bolster accusations that his government has been hijacked by a small group of individuals.
Critics say a large number of people have been appointed because of their relationship with those people in one way or the other.
Mrs Buhari was prompted to to speak out in an effort to end those practices so that party loyalists who contributed to his election victory could benefit.
Her critics say she is speaking out only because she failed to convince the president to appoint her own people.
However, as the closest person to the president, she must have exhausted all avenues before criticising him in the media.
The comments could also mark a turning point for a government that has clearly struggled to deal with economic recession and is facing growing disquiet within the ruling party.
The Nigerian economy, battered by low global oil prices and a currency devaluation, officially entered recession in August for the first time in a decade.
Oil sales account for 70% of government income.
The president famously remarked at his inauguration that he "belongs to nobody and belongs to everybody".
Asked to name those who had hijacked the government, she refused, saying: "You will know them if you watch television."
On whether the president was in charge, she said: "That is left for the people to decide."
Mrs Buhari, who at 45, is 23 years her husband's junior, said he had not told her whether he would contest the 2019 election.
"He is yet to tell me but I have decided as his wife, that if things continue like this up to 2019, I will not go out and campaign again and ask any woman to vote like I did before. I will never do it again."
Nigerians have been weighing in on Twitter to give their judgement on the first lady's frank interview:
Asked what she regarded as the government's major achievement, she said it was to improve security in the north-east where militant Islamist group Boko Haram has waged an insurgency since 2009.
"No-one is complaining about being attacked in their own homes. Thankfully everyone can walk around freely, go to places of worship, etc. Even kids in Maiduguri have returned to schools," Mrs Buhari said, referring to the city which was once the headquarters of the militant group.
Nigerian President Muhammadu Buhari's wife has warned him that she may not back him at the next election unless he shakes up his government.