In this post, you will find a configurable gear for Solidworks.
If your version of Solidworks includes the Toolbox Add-In, you should check this page which presents a better option for inserting gears in Solidworks.
The following parameters can be tuned:
Solidworks part can be downloaded here: