Buhari's blatantly sexist remark came during a Berlin news conference with one of the world's most powerful women, German Chancellor Angela Merkel.
"I don't know which party my wife belongs to but she belongs to my kitchen and my living room and the other room," said the president, whose popularity at home has plummeted amid a deep recession.
Buhari was responding to a BBC interview in which his wife, Aisha, a businesswoman and activist, questioned his leadership and suggested she may not back his re-election bid unless he shakes up his government.
Buhari told reporters that he can "claim superior knowledge over her and the rest of the opposition" after running for president three times and succeeding on his fourth attempt.
There was no immediate reaction from Merkel, who is called a Machtfrau -- a woman of power -- in Germany for managing to reach the top as an outsider in a male-dominated world.
Presidential spokesman Garba Shehu later took to Twitter to dismiss Buhari's comments as "banter."
"Politics sometimes should be spiced with humour," he tweeted. "Those of us around him know there is never a dull moment with him."
Shehu tweeted that the fact that a woman, Kami Adeosun, holds one of Nigeria's most sensitive government posts as finance minister, was evidence of Buhari's confidence in women.
But critics took to social media to denounce Buhari's sexist remarks.
A UK-based cinematographer, writer and filmmaker with the Twitter handle @iamMrBoro wrote: "This is not about Aisha provoking Buhari, this is about Buhari's mentality about the role of women in society."
Editor and writer Maryam Kazeem tweeted: "President Buhari's lack of respect for his wife and women should not come as a surprise."
Buhari took over last year from Goodluck Jonathan, inheriting a nation with a stubborn militant insurgency and lingering fuel shortages, a paradox for one of the world's largest oil producers.
He was sworn in as president in May 2015 but the former general was among military strongmen who dominated Nigeria decades ago. A military coup first brought him to power in 1983, and another military coup toppled him two years later.
Buhari's regime was known for its "war on indiscipline," which critics say was marred by human rights abuses.
Last month, what was supposed to be a rallying cry for unity in a nation deep in crisis
quickly soured as Nigerians took to Twitter to vent their frustrations.
The launch of Buhari's "Change Begins With Me" campaign was widely met with scorn. Some felt the sentiment was tone deaf and failed to address the myriad problems Nigerians face on a daily basis, including mass youth unemployment.
Nigeria's second quarter GDP fell by more than 2% in August, compared to last year, after slipping by 0.4% in the first quarter. Two consecutive quarters of decline mean Nigeria has now slid into recession.
While he has been tough on corruption, Nigerians feel his authoritarian approach is out of touch when he should be inspiring hope for better times.
Since taking power in 2015, Buhari has been fighting a war on many fronts, including the Boko Haram insurgency which has been blamed for a looming famine crisis in the north east of the country.