Meaning
A chaotic, anything-goes place with no rules; a free-for-all.
Example
Desde que o gerente saiu, o escritório virou a casa da mãe Joana: ninguém cumpre horário.
Since the manager left, the office has turned into a free-for-all: nobody keeps to their hours.
Origin
The standard account traces the phrase to Joana I, Queen of Naples and Countess of Provence (1326–1382). While living in Avignon, France, she is said to have regulated the city's brothels around 1347, with one rule that each house "have a door through which all may enter." A regulated, open house became known as the paço da mãe Joana ("Mother Joana's court"); carried into Portuguese and then to Brazil, the archaic paço was swapped for casa, giving "casa da mãe Joana."
Sources: Ciberdúvidas, Só Português.
Practice idioms with the Idiom Trainer
Falando's Idiom Trainer teaches you to recognize idiom meanings and create sentences using them, so you can speak like a Brazilian.