I always seem to compile the code but forget to save. Albeit I do save every now and then, but I want to know if it automatically saves when I compile the code, just incase my laptop hangs or something happens that might make me lose my work in the future.
Yes. It calls an external program to typeset, so it must save the file first. Mac OS always gives a visual indication if the file has unsaved changes: the red "close window" button is blocked out. You will notice that the button clears whenever you typeset.
(Version 2.45 had a bug where it did not automatically save when typesetting. However, you would surely notice this, since changes would not appear in the output until you saved the file.)