The defending champion overcame the 31st seed 6-4 6-3 7-5.
Stepanek, 34, had a break point in the seventh game which was he was unable to convert and then didn't get another until the eighth game of the third set, such was the top seed's dominance.
It was an entertaining affair but Djokovic remained in control throughout.
The Serbian will play the winner of a third round clash between American Sam Querrey and Swiss Stanislas Wawrinka.