Najdah bin Amir wrote a letter to Abdullah bin Abbas (may Allah be pleased with them both): Tell me who are the relatives whom Allah has mentioned, that they are to be given from the fay', which Allah granted to His Messenger without fighting? When does the orphan's orphanhood end? Are the children of the polytheists to be killed? If women and slaves go to battle, is there a fixed share for them? Ibn Abbas (may Allah be pleased with them both) said: Were I not afraid that he would fall into this, I would not write. So he wrote, and I was present: By the relatives we hold that only the relatives of the Messenger of Allah (peace and blessings be upon him) are meant, though our people have refused that. As for the children of the polytheists, the Messenger of Allah (peace and blessings be upon him) did not kill any child, so you too do not kill, unless you know what al-Khidr (peace be upon him) knew about the boy whom he killed. The end of orphanhood is reaching puberty and maturity of mind becoming apparent; then his orphanhood has ended, so now give him his wealth. And if women and slaves go to battle, there is no fixed share for them, but give them something from the spoils as a gift.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17966