Texture painting (and any images in general) are saved as separate files in blender by default! They're not saved as part of your .blend file. You can press alt+s while your mouse is in the image viewer (or just click the image dropdown menu at the top of the image viewer, which should have an asterisk if your image is unsaved) to save the image.
Alternatively, you CAN pack the images into the blend file! Under the file menu in the top left, select external data > pack resources. Then, whenever you save your blend file it should ask if you want to save the image too. note: you DO need to have saved a separate copy of the image first for this to work, but you do NOT need to keep the separate copy after you've packed the file.