here's a link with some info for the TDF.
http://www.torelli.com/kom/tdf/rating_climbs.htm
It's up to the organizers, and it does vary with factors such as road quality, placement in the race, history etc. Typically a category 4 climb would be 1 to 2k, and 4-5% grade.