Well, if you don’t have many bags, the Airport Express that leaves from Dongzhimen at the northeast corner of Line 2 and has a stop at Sanyuanqiao at the Northeast corner of Line 10 is always reliable.
Really it also depends what part of the city you are coming from. I used to live near Dongzhimen right at the end of the Airport Expressway, I could reliably be at the airport in less than 30 minutes in off peak hours.
I guess the peak hours would be from 7AM-9AM and 4PM-8PM. I have a memory of grabbing a taxi from Great Leap Brewery in Sanlitun around 7PM on a weekend night, and traffic being pretty bad. My first job was pretty close to the airport on the Second Airport Expressway, my first year the route from my apartment was the Second Airport Expressway, my second year I moved and my route was all the way to the end of the Airport Expressway and looping back to the Second Airport Expressway. Generally, even in morning rush hour traffic still moved, but a couple of times a month there would be an accident that would snarl traffic, or there would be a foreign or Chinese leader who caused the highway to be closed down for his ground transportation from the airport. Usually though, once you make it to the Airport Expressway you are in the clear. Last year I worked in Haidian, the northwest corner of Beijing, and going from my job to the airport was less reliable, because it was such a long journey with more choke points, I wanted to leave at least 2 hours before I needed to be at the airport. Much of it depends where in the city you are, if you are near the Airport Expressway or Second Airport Expressway, there is less potential for unexpected delays. But, traffic in Beijing is a potential nightmare anytime between 7AM and 9PM, with unexpected car accidents or road closers for VIP convoys.
Honestly, if you have to go to the airport at peak afternoon traffic hours, I recommend the train, much more reliable.