To rephrase your question a bit patent lingo: "Am I an inventor who should be listed on the patent that will be filed on the product I am working on?" (where credit == inventor)
Technical Answer: Maybe. You must contribute novel aspects to the patent-able idea and those contributions must appear in one or more claims. If someone gives you the idea to build and you build it, without going beyond the original idea, or going beyond in ways that don't show up in the claims of the final patent, you are not an inventor.
Practical Answer: You can't tell inventorship until you see the final claims. If you are under an obligation to assign your patent rights to the entity who will hold the patent in the end and your contribution is potentially patentable and you can clearly articulate what that contribution is, then there is a good chance they will add you as an inventor if you ask. A patent with incorrect inventorship is unenforceable until inventorship is corrected, so getting inventorship right is important for the value of the patent.