If there are no measurable cardinals, or just if there are no measurable cardinals $\leq\kappa$, then the answer to your question is yes, and in fact all homomorphisms from $\prod_\kappa\mathbb Z$ to $\mathbb Z$ are linear combinations of the $\kappa$ projection maps. If, on the other hand, $\kappa$ or some smaller cardinal is measurable, so $\kappa$ supports a non-trivial, countably complete ultrafilter $U$, then the "in fact" clause in the preceding sentence is false; a counterexample is given by the homomorphism sending any $f\in\prod_\kappa\mathbb Z$ to the value that $f$ takes at $U$-almost all elements of $\kappa$. I believe that Hom($\prod_\kappa\mathbb Z,\mathbb Z)$ may nevertheless be free (though with a more complicated base than just the projections), but this probably depends on detials of the structure of the countably complete ultrafilters on $\kappa$. (In a couple of days, I'll be back in Michigan, where I can look in my copy of the book "Almost Free Modules" by Eklof and Mekler, where the section on the Los-Eda theorem should give me a lot more information about this. Anyone who wants to look for themselves rather than waiting for me should take into account that "Los" here is really "{\L}o\'s".)

Edit: OK, I'm back in Michigan, and I'm looking at Corollary 3.6 of the Eklof-Mekler book. It's stated in more generality than the present question wants (using slender modules over general rings), but if I specialize the ring $R$ and all the modules $H$ and $M_i$ in this corollary to be $\mathbb Z$, it tells me that Hom($\prod_\kappa\mathbb Z,\mathbb Z)$ is freely generated by the homomorphisms that I described above, one homomorphism for each countably complete ultrafilter on $\kappa$ (including the principal ultrafilters, which give the projection homomorphisms).