Limit size of groups

I'd like to limit the size of groups to 20 people, and have the group change from "open" to "invite only" when it hits that size. Is this possible? Thank you!