It should use all the threads, and if there's enough sticking out to put a nut and washer on the other side so much the better. If it does protrude through the eyelet, though, there's a chance that the chain will catch on the bolt (or the nut) when you're in your highest gear, just like rogerstg said.
Lots of hardware stores have metric fasteners, or you could try an auto parts store.
I run into this problem when I use a cassette with a 12 tooth smallest cog (highest gear); with an 11 tooth the chain clears the bolt just fine.