Say this when you want to speak to a large group of people. When you say this, it means that you want everyone to be quiet and listen to you. After that, you usually make an announcement, propose a toast, or give a short speech. You can use this at a party, at home when you have something important to tell your family, or at work in a meeting when you want to ask everyone something before the meeting starts.
There's a similar phrase that you say when you're making an announcement over a speaker or intercom, like in a school or on a train:
May I have your attention please?