I want to use my Atmega328P in 8MHz, but I noticed that the internal clock is not as accurate and cause problems in my application. To add an external crystal 8MHz I do like the image below or 22pF capacitors are only necessary when I use a 16MHz crystal?
Yes, you require the capacitors, and the capacitors have to be the right value for your crystal.
The datasheet will specify a load capacitance which you use in the following formula:
C1 = C2 = 2(CL - C_STRAY)
That is, the load capacitance of the crystal, minus the stray capacitance from your circuit (as long as your traces are short that is negligible and can be largely ignored unless you have very very tight timing requirements) multiplied by 2.
So for 22pF capacitors it is safe to assume that the crystal that is with them has a load capacitance of 11pF.
So check the datasheet for the load capacitance (it should be very prominent) and select the correct capacitors accordingly.
If you want to do away with the capacitors and your timing requirements aren't that precise you may get away with a ceramic resonator which doesn't require capacitors.
Another option is to use a MEMS® clock chip which generates a stable clock signal at a pre-set frequency. While this doesn't require capacitors for the clock signal it does still require a decoupling capacitor on the power supply for it, but of course that doesn't affect the timing of the clock signal, so precise selection of a specific value isn't needed.