Up to what age can a child stay in jail with the mother?

If the mother is in jail, what is the age of the child who can stay with her and who takes care of the child?

If a child is born in jail, various questions arise in everyone's mind regarding it.…