Time zones are a far worse mess than immediately meets the eye. Fifteen degrees of longitude would be nice, but as the fearsome Lord Brawl observes, the zones themselves are gerrymandered everywhere in order to conform to national and provincial borders, sea coasts, etc. But that's no big deal.
How do you define a time zone? First, there's the offset from UTC (Universal Coordinated Time, rearranged for French grammar). The offsets range from -11:00 hours for Samoa, all the way around past the International Date Line to +14:00 hours for the tiny Pacific island of Kiritimati (the artist formerly known as Christmas Island), east of Samoa. Then you've got the oddballs like Newfoundland at UTC-3:30, and the innovative Chatham Island (New Zealand) at UTC+12:45. Oh, boy!
But that's the easy part.
Where it turns into a genuinely weird mare's nest, is when you throw Daylight Saving Time into the mix. The US state of Indiana is at UTC-5:00, US Eastern Standard Time (EST) -- but Indiana doesn't observe Daylight Saving Time1. Half the year, they're on the East coast; the other half, they're in the Midwest. If you're writing software to handle time, the best way to deal with mutants like Indiana is to define a time zone as the aggregate of the values of all the properties a given area has: UTC offset, DST offset (most of them are an hour, but some are half an hour or whatever), DST start date and start time (not all start at 2:00 AM local time), and DST end date and end time. Since winter and summer in the northern hemisphere are the reverse of those in the southern hemisphere, DST down there starts around the time it ends up here, and vice versa: Quito (Equador) and Baltimore (USA) are at about the same longitude, but their DST adjustments are totally incompatible (for one thing, as Linca rightly observes, Ecuador is on the equator (hence the name) so there's very little sense in observing daylight savings time there anyway -- and they don't. So I'll have to dig up someplace else on Baltimore's longitude but far enough south to do DST).
Thanks to DST, A "time zone" cannot be defined as "all locations which share the same base offset from UTC". Rather, a "time zone" is best defined as "the set of all locations guaranteed to share the same UTC offset at all times". If some little village in Vermont decides to start Daylight Saving Time five minutes earlier than the rest of the state, that guarantee is broken for Vermont w/r/t that little village, and the village has just become its own time zone for all practical purposes. And practical purposes are the only ones that interest me when I've got a ship date breathing down my neck.
The standard library that ships with your operating system almost certainly doesn't have the complete picture; that which ships with Windows is okay for the most part, but don't trust your laptop clock if you've got any important meetings on Kwajalein. You'll show up a day early. Furthermore, rarely does a year go by when somebody, somewhere, doesn't enact a new law and render your information obsolete.
Hooray for Red China: The whole damn country is UTC+8:00, with no DST anywhere.
Going by the pragmatic definition outlined above, there are roughly five hundred and twenty-nine (529) time zones on Earth as of Spring, 2001. That's not a typo. I may have missed a few.
1Most of Arizona doesn't observe Daylight Saving Time either; thanks to some_guy for reminding me.