The Zodiac sign of a month is decided by the month when the Sun is "in" that sign from the point of view of Earth.
(See Mike G's comment below - because of the precession of the Earth, Zodiac signs are now 30 degrees "off" from their original markings/associations with the months of the year.)
I believe that August is actually the month of the Leo, not October - more specifically, July 23 to August 23. (see here for more date info) If you look at the diagram, you'll see that the Sun is right in front of Leo from the point of view of Earth during the month of most of August, and thus we call that the month of the Leo. Some more examples - during October, the month of Libra, the Sun is directly in front of Libra, and during March, the month of Pisces, the Sun is directly in front of Pisces.