You have to change to the right directory first. So put this in front of the for
-loop:
os.chdir(path)
If your python script is in another directory, that will be the working directory and since you only have filenames and not absolute file paths, the files can't be resolved in that working directory. Changing to it therefore solves your problem.
As a side note, your loop could be a bit simpler. This should do the same:
for x in files:
new = 'DSC0%d' %(num)
os.rename (x, new)
num +=1