No the History is only stored as long as the fie is open. There is no way to save it as part of the file. But you can easily create new documents from stored Snapshots or History states, and save those out.
If you want to make sure you don't lose a previous state of the image, then make sure you save a version down.
It is possible to set Photoshop > Preferences > General > History Log to keep a log, but that would probably be of limited use to you. (Check out »Set Edit History Log options« in the Help if you are interested.)
Another option would be to keep »ScriptingListener.plugin« in the »Automate«-Folder as that produces code that is executable from ExtendScript Toolkit; but certain procedures (painting etc.) can not be recorded that way and file-traffic (opening, closing, switching between files) may make that record pretty much useless anyway, so it’s rather academic.
Europe, Middle East and Africa