The W&OD is a Virginia state park. Officially it is open from dawn to dusk, per
here. I'm not aware of a formal exception for bikers. Unofficially, there's no problem riding at night.
The Capital Crescent Trail is a bit more of a kluge as far as its ownership. Montgomery County MD and the CORRECTED -- National Park Service (not city govt in DC as I first wrote) both have skin in the game and were behind its development. The friends of the CCT are pretty active. Their
safety page does not cite hours but does provide guidelines for activities after dark, so implicitly it is open at night. That is inconsistent with the default Montgomery County
parks hours (closed dusk to dawn unless otherwise posted), and I can't recall ever seeing hours posted. But I've been riding it for years, have occasionally passed or been passed by police on the trail after dark, no problem -- in DC or MD. (I don't know what the official hours are for the DC portion)
In short -- no problem. Except for the standard night problems of ninjas, blinding lights from oncoming $700 hi-aimed HID boy, epileptic seizures from following a rider with a superflash, etc.