Yes, your thinking is correct, and the water is a byproduct of combustion. Let's examine what happens.
Many combustion reactions involve reacting hydrocarbons with oxygen. Hydrocarbons are any molecule consisting of hydrogen, carbon, and sometimes oxygen. The byproducts of these are always CO2 and H20, so carbon dioxide and water, or the infamous dihydrogen monoxide. Notable hydrocarbons include butane (C4H10), propane (C3H8), and sugar (C6H12O6), which also is a large component of wood. Kerosene, diesel, and, as you asked about, petrol all involve different kinds mixes of hydrocarbon chains which change based on what season it is, what region you're in (if you're American) or, I'd imagine, what country you're in.
A hydrocarbon combustion reaction looks like this (the lowercase letters are variables denoting the number of atoms in each molecule)
HxCyOz + O2 => H2O + CO2
Obviously this is not a balanced equation, and I'm sure you could do a bit of algebra to figure out what the balanced equation for any hydrocarbon, but I won't.
So the reason you're seeing water coming out of the tailpipe is that the petrol is combusting above 495 degrees F (I'd imagine this would be varying temperatures based on engine design, and according to the heat engine model, a hotter temperature engine is more efficient) and then cooling down as it leaves the pipe. Now the exhaust system is hot, don't get me wrong, but it's nowhere near as hot as the air coming out of the pistons, which is the source of the heat in the first place.
Since the air coming out of the engine is fully saturated with moisture, any drop in temperature will cause the water to precipitate out. A cold winter's day is going to amplify this effect.