It means a minor under the guardianship of the Court of Chancery.
This was a real concept in those days - indeed it still is, but such children are nowadays more often referred to as "wards of court". Most of the search engine results I found for "ward in chancery" are genealogy forum threads where people were asking about their own ancestors: for example this and this. I did find one page about "wards in chancery" which was specific to G&S:
Wards of the Court of Chancery, i.e., persons under that court’s protection. This perhaps explains why Major-General Stanley could be the father of so many lovely girls all between the ages of 18 and 22. How he managed to have this charming collection farmed out to him has never been explained.
To understand this fully requires an understanding of one of the most tricky and esoteric parts of the English legal system: equity law, specifically as it applies to trusts.
A trust is the situation arising when one person or legal entity (the trustee) is holding assets on behalf of another (the beneficiary). The trustee has all legal and administrative rights to the assets, but is obligated to act in a way that is to the advantage of the beneficiary. This system is commonly used by the rich as a (legal) way to dodge tax, and trust law in England specifically has a long history. There can be multiple trustees or multiple beneficiaries involved in a given trust, and the laws governing trusts are particularly complex, more so than common law.
One particularly common way for trusts to arise is when the beneficiary is a minor. Since minors are not able to govern their own financial affairs, it is necessary for someone to take up the role of trustee. Normally a child's parents would have this role, but there are special cases when inheritance law is involved. If a person dies and bequeaths some of their assets to a minor, then a trust is automatically set up with that minor as the beneficiary. Again the trustee(s) would usually be the minor's parent(s) ... except if the people who died were themselves the parents. In this case, the now orphaned child may find themselves the beneficiary of a trust, perhaps for a sizeable amount of money, but with no trustees. This is where the Court of Chancery comes in.
The laws governing trusts are part of equity law, which is a separate entity from common law and, up until the late 19th century, was in England administered by a specialised equity court, also known as a chancery court - namely, the English Court of Chancery. This was dissolved in the 1870s, but the Chancery Division remains a separate branch of the English legal system and of the High Court of Justice to this very day. From Wikipedia:
The Court of Chancery was a court of equity in England and Wales that followed a set of loose rules to avoid the slow pace of change and possible harshness (or "inequity") of the common law. The Chancery had jurisdiction over all matters of equity, including trusts, land law, the administration of the estates of lunatics and the guardianship of infants.
So, in a situation where a minor without parents stood to inherit a considerable sum, it was the Court of Chancery which assumed responsibility for that minor and their assets until they came of age. Under the terms of trust law, the court, or its chosen representative, had the right to make decisions about the child's upbringing and how to use their assets, on the understanding that everything it did was for the child's own good. Thus, that child was not only a "ward of court", but specifically a "ward in chancery".