Why does blender close when rendering?

I have a weak computer. (The advice to buy a new one is not funny).
And blender closes during image rendering.
But when I run the render in the viewport, it works fine.
Why is the load higher during rendering?
type render:eevee

Well. The viewport generally corresponds to a part of screen, while the render is a bigger image at a resolution of a full screen or higher.

Also, by default, all render settings are lower for the viewport, to increase speed of a viewport render, at detriment of quality.
That is also the same for modifier settings like Subdivision Surface modifier.

So, try to lower Render Settings. If it still crashes, there may be more issue than just the load.

Here, you can find minimum requirements to use Blender.

How to optimize rendering. I am quite happy with Viewport but it does not allow use compositing.
I have a cartoon stylization, so I probably don’t need much.

I started to learn CG in 2019 and I had an old 2012 refurbished notebook, my card was a GT 740M so I had to optimize everything. Looks awkward but I suggest you switch to Cycles. Eevee mainly works using GPU, but if your scene exceeds the amount of VRAM available, it crashes, Blender just shuts down. Using CPU compute will allow your computer to use memory swap, it’s slower but won’t crash and you can finish your art. Try rendering using a very low sampling value using the command line, with denoiser. Learn to use output node in compositing tab. For animations you will have to reconstruct the beauty pass in the compositor and denoise just direct and indirect passes to avoid temporal flickering. Use instancing for duplicated assets, always apply your modifiers before rendering, avoid 4K output resolution and textures higher than 2K. Good part is that I’ve learned a lot of optimizations for CG and it’s very useful at work. Truth is that most artists have good machines and they just create a setup and let the computer render for hours or days, they don’t even think about hardware or anything related to optimization.

It’s a lot of information and will take a while to digest. You will need to learn a lot to compensate your lack of resources, but in time will will get a nice workstation.

8 samples denoised 1080p example, asset has SSS:

4 samples denoised 1080p example:

It consumes more memory during rendering.
Check the amount of RAM(VRAM) used during rendering, and if a lack of RAM is a problem, optimize the scene to reduce the amount of RAM used, or reduce the amount of rendering samples in the rendering settings.

The default sample settings for EEVEE are
The number of viewport samples is 16, and the number of rendering samples is 64.