How close to the White House did the Space Shuttle Discovery "fly"?
According to this article they cruised through DC at an altitude of 1,500 Ft. Based on the pictures you can see here and here and here and lastly here of the flight and some of the locations it banked at its course seems to have taken it right around the prohibited flight area noted in Carlo's answer which you can see on the sectional here: 


(source)

Foreflight does a better job of overlaying that on a street map. Assuming they kept a reasonable margin if we drop a ruler on it Im showing ~0.6 NM



(source: own images)

As for special clearance they were flying the the SFRA and would need to follow the rules on that as everyone else. Im sure the course was prearranged as the FAA prefers transitions more than loitering in the SFRA. The SCA also had a fair number of limits to its flight regime as discussed in this podacast the weather would have also needed to be optimal for the flight to occur.