It’s not OK to ask, “when are you going to have a child?” This simple question has such an impact on too many people for numerous reasons including: It can be extremely heartbreaking. You don’t know what someone else has gone through or is going through. It can be frustrating. There is no set plan in life for people to follow.
This is their choice and you shouldn’t question it. I understand sometimes it’s general chitchat but if that’s the case rephrase the question to something like, “Do you plan to have …” Be aware you may be put into an uncomfortable situation as their story behind it could be very upsetting.