There are 'rules' for this and even though I've had it explained to me, I can't remember exactly what they are. I do know that when I was doing a training program in Beijing a few years ago, one of my translators told me a bit about it and in fact she and her husband were restricted to one child. One the other hand, one of the technical people who I worked with moved there from South Korea and she and her husband could have two children. Another couple I met originally lived in a rural district and it appeared to have some other level of restriction (I can't remember exactly what it was but I believe they were allowed to have at least two.) There are plenty of exemptions to the rule including entire ethnic populations. If one (or perhaps it is both) of the parents were from one child families, they were allowed to have more than one. There's another exemption that has to do with whether the firstborn is a boy or a girl, if a girl the couple is allowed to have a second child. There is another rule that has to do with whether the firstborn has some type of deformity.
Also, if a man is unfaithful to his wife all the babies he makes count against the policy of whatever number has been decided for that couple.