The US Post Office sells a subscription to map 5 digit zip codes to City/State values. As @Timothy says, the mapping is one to many. However, the post office db does mark which city/state is the "primary" for a given zip code.
Don't know about other countries. Check with your country's postal authority.
See http://www.usps.com/ncsc/addressinfo/citystate.htm