You could use for loops with indices, or similarly Do loops, or While structures or perhaps Table. But far easier is to use MapThread in this case:
fns = ToString[#] <> ".jpg" & /@ Range[1, 20]
newfns = ToString[#] <> ".jpg" & /@ Range[21, 40]
MapThread[RenameFile, {fns, newfns}]
This will apply the function RenameFile to each pair from the variables fns and newfns.