Good Morning,
There are two approaches you could take here.
The first would be to have as you have suggested a question How Many children?, followed by Child Name 1, Child Age 1 etc.
You can then use dependencies to hide each child field, for example for Child 1 Name you would hide the field when Number of Children < 1, for Child 2 Name when Number of Children < 2 etc. This would allow the correct fields to appear as the number increased, however this would be limited to the number or properties you created in advance in your object.
A better approach might be to create a related object for storing Children, and use an edit list to allow N number of children to be added.
Please let me know if you have any further questions.