Most common situation when this counter is used is in services (e.g. restaurants) - when entering the staff will ask you “なんめいさまですか。” - how many people are in your group? (Note that you shouldn’t reply using めい - it’s considered arrogant to do so. To stay humble reply using にん (nin) counter.)
The usage is not limited to services though. It’s also used to count participants on various formal occasions (ceremonies, meetings), or count names in a list, and also in articles when reporting for example how many people were involved in an incident.

No. Kana Kanji
1 いちめい 一名
2 にめい 二名
3 さんめい 三名
4 よんめい 四名
5 ごめい 五名
6 ろくめい 六名
7 ななめい 七名
8 はちめい 八名
9 きゅうめい 九名
10 じゅうめい 十名
11 じゅういちめい 十一名
12 じゅうにめい 十二名
13 じゅうさんめい 十三名
20 にじゅうめい 二十名
21 にじゅういちめい 二十一名
100 ひゃくめい 百名
1000 せんめい 千名
10 000 いちまんめい 一万名
100 000 000 いちおくめい 一億名
How many なんめい 何名


Check out other counters.