Here's some info that may be of help. Let's start with the gun itself. Most metals used in guns expand with heat and contract with cold. Because handguns typically don't have massive metal parts like a rifle barrel, long receiver, or bolt, this is never an issue. Polymer material used in handguns is pretty much immune to temperature and neither expand or contract, nor does polymer get brittle like plastic.
Oil and especially grease are your biggest enemies when it comes to function in cold weather. It's best to use the absolute minimum amount of oil ... no oil is even better and never use grease in any gun ... never, even in in warm or hot climates.
Condensation is always an issue when storing a gun in a car. As metal gets cold then warms up, moisture will form (condensation) and cause corrosion or rust on the surface of any metal parts, to include internal parts. Oil doesn't help because condensation will get between the metal and the oil and still cause corrosion. The best way to fight condensation is to keep the firearm in a sealed container ... much like a GI ammo can. This will prevent moisture from accumulating even in extreme temperature changes.
As for ammo ... not to worry about moisture getting inside with centerfire cartridges. The bullet seals with the case as does the primer. 22 LR ammo is a different story because bullets are often loose in the case and can be ruined by temperature and barometric changes that literally sucks moisture into the cartridges.
A very significant issue can happen with handgun ammo in cold weather conditions. First, all powders are much harder to ignite when cold. Magnum powders are the worst and may even squib when fired at sub zero temperatures. Besides being harder to ignite, powders for handguns are not temperature compensated like many rifle powders and will not produce normal velocities in colder climates. This is especially noteworthy for semi-auto pistols because there may not be enough pressure generated to cycle the slide. If you have an older Speer manual, they list velocity versus temperature for rifles and it is even more dramatic for handguns.
My concerns with leaving a gun in a car has more to do with theft than with climate conditions. A lockbox has "steal me" written all over it plus it's very difficult to put your firearm into service if needed when it is locked up.