Imagemagick should be able to do it.

Here's the first relevant-sounding page I could find.

http://dptnt.com/2009/04/how-to-add-date-time-stamp-to-jpeg-photos-using-free-software/