I believe the DVI spec states that a cable should not be more than 5 meters (roughly 16.4 feet). Of course the real determining factor for how long a cable can be is it's level of attenuation of the important frequencies (which increase as length increases, of course). So a very good cable should be able to deliver a reliable signal over a longer distance, and you can buy longer cables from various places online. You can also use repeaters (which are unfortunately rather expensive) to go longer distances. I believe the HDMI spec states only the signal carrying characteristics of a cable, rather than length. Check www.hdmi.org for more info.
The nice thing about DVI (and HDMI) is that since they are digital you will know very quickly if the cabling is not of high enough quality. In that case you will get gross and obvious errors in the picture, or (even more likely) no picture at all. The picture won't get slightly fuzzy or noisy as happens with analog cables which are too long.