When my kids cursed for the first time I didn't punish them because they really had no clue what they were saying. I calmly explained to them that those words are not for children and that if they don't know what a word means then they should ask me before they go around saying it. If they know the words are bad and say them anyway, its time to take away privileges or give them 5 to 10 minutes of quiet time for every bad word they say.
I explained to my youngest it is a bad word and you don't say them. I think it also matters on where he picked it up. For my it was my son's uncle. So then I had to tell him to watch his language around my son.