In Affinity Photo all edits you make are saved in the document history, not just for the current session but for any subsequent session too. You can also save your project as an .afphoto file at any time. Where this file will be written to depends on whether you have imported an image or opened an image "in place".
Affinity Photo's Home screen acts much like a series of "tabbed" documents you would typically find in the desktop version. All documents are stored internally as part of the app's storage, but you can also save them out. If you have opened a file "in place" (e.g. from cloud storage), the document will be saved back to that file. If you have imported a file, and thus created a copy, the document will be saved to either local iPad storage ("On My iPad") or to iCloud Storage (in a directory named "Affinity Photo") where you can easily access them. The choice of save location is determined by the Preferences option.
If you have imported a RAW image or an image from your Apple Photos library, a saved Untitled document will always be created. For other imported documents (e.g. .afphoto or image files), the existing filename will be used.
If you need to undo your work at any time, you can use the History Studio to scroll back to a history step from which to begin editing again; history steps subsequent to this step will be replaced by your new editing steps.
If your document is newly created, you may like to rename it from 'Untitled' to something more meaningful and memorable.