Hi, it depends whether a word ends in a voiced or voiceless sound. Vowel sounds are voiced, consonants can be either voiced or voiceless. Take a look at this:
http://eleaston.com/pr/s-z-Iz-pattern.htmlClick on "voiced sounds" and "voiceless sound", you'll find some info. Consider that not everyone follows that "rules". I sometimes hear "kids", "girls" and similar words pronounced with an /s/ sound. There are regional variations too, I guess.