Are you looking to model the gear exactly, or roughly for basic design work? (If exactly, see below; if roughly, use a cylinder the size of the pitch diameter.)
And will you be manufacturing gears yourself, or are you just wondering how gears are made industrially? (Either way, some ideas and references are presented below. The usual mass-production way is
hobbing, but many other methods exist.)
Lots of existing threads on these topics exist (often with links to external tutorials). Some examples: