I was able to get my 9mm pistol completely upgraded as soon as Workbench #6 in the The Suburbs - Suburbs chapter. By that time, I had found the 3rd workbench tool which allowed me to complete all the upgrades.
If for some reason you're not able to accomplish this on your first playthrough, then definitely your 2nd.