This is just one of the countless gestures integral to communication in Brazil, and never taught in any Portuguese class. The estalo brasileiro, or Brazilian snap, is used to indicate speed; sometimes it’s used to (rather rudely) tell someone to pick up the pace.
To snap like a Brazilian, start with your hand pretty much as it would be for the international version of the snap, in which your middle finger ends up hitting the base of the thumb. In the Brazilian version you keep your middle finger pressed against the tip of your thumb and the sound comes from your index finger hitting your middle finger as you waggle your arm. Keep your index finger very loose.
As you can see in the instructional video above, I completely failed at this, much to the delight of the Brazilians who instructed me. I do hope you’ll fare better.
Someone else has created a more sober (though not necessarily more useful) demonstration of the same.