Massad Ayoob teaches 21 feet.

21 feet can be covered by the average person in 1.5 seconds which is slightly faster than the average draw of roughly 2 seconds.

Since holster security (read- hard to get out) has improved it is good policy (read- a good idea if you don't want to die) to unholster your weapon if the individual in question is within 21 (more like 30 as far as I'm concerned) feet.

If someone is really close I would prefer to leave my gun locked in the holster and use my hands (read- knife).

I posted this elsewhere but watch this video.
If you are interested in a martial art that deals with knives then go look for Silat in your area.
http://www.youtube.com/watch?v=nYAXjKkLmJs