他
他 is used for males and someone(s) whose gender is either unknown or unimportant.
So for a group of both females and males, normally 他们 should be used. For a group of people of females, 他们 could be used where there is no implication on the genders of the people in question. For example, if you are talking about a group of people, who are not necessarily all females, but happen to be all females and this fact is not important, you can use 他们. If the group in question is obviously all females, you'd better use 她们, e.g. Referring to four queens as 他们 is not recommended.
她
她 is used for females.
This is only applicable when referring to single female or a group of females.
它
Both 他 and 她 are used for people.
For things, use 它 no matter it's a concrete object (a pen, a dog) or abstract object (a country, an ideology).
If you use 它 referring to people, there would be an implication that the person being referred to is not considered human. This normally is an insult in Chinese culture and the person may be offended.
Unlike English, baby is considered people, so don't use 它 for baby.
Anthropomorphically, 她/他 can be used to refer things other than people, commonly pets and animals.
你 vs. 妳
If you are writing in Traditional Chinese, there would also be a gender distinction in the second person pronouns as 你 vs. 妳