What are the differences between 男女, 公母, and  雄雌? In what situations would you use one of the following instead of the others? 


  男女 nán nǚ
  
  公母 gōng mǔ
  
  雄雌 xióng cí


Is it a matter of formality or is each term confined to a particular field (e.g. biology)?
男女 is used only for humans. 

公母 is normally used on animals. 

雄雌 is more academic.

公母 is usually used with terms closer to everyday life: 


  公鸡 / 母鸡 gōngjī / mǔjī for cock / hen


For biological terminology, usually 雄 / 雌 would be used: 


  雄蕊 / 雌蕊 xióngruǐ / cīruǐ for stamen / carpel




Here are more characters for "male" or "female":

郎猫＝公猫

米猫＝母猫

儿马＝公马

骒马＝母马

草驴＝母驴

叫驴＝公驴

牡＝公的

牝＝母的