Connecting 5 pin 3.5MM Stereo Jack Socket to TDA2822M
I don't know the pinout, but you can deduce it either by looking or by measuring. One pin is connected to the outer ring, this is nearly always used as ground.

The other four pins connect to the two channels. Let's call them L-SIGNAL, L-LSP, R-SIGNAL and R-LSP. Without a plug in the socket, L-SIGNAL and L-LSP are connected, and the R pins are likewise connected. With a plug inserted, L-SIGNAL and R-SIGNAL connect to the plug, and the *-LSP pins are disconnected. Using a multimeter or your eyes you should be able to find out which pins are the R pair and the L pair.

The standard use for such connectors is to connect the *-SIGNAL pins to the amplifier, and the *-LSP pins to the internal speaker. This way the speaker gets the signal when no plug is inserted, and only the headphone (or external speaker) gets the signal when a plug is inserted.

When you just want to connect a headphone (no internal speaker) you can simply connect both L-SIGNAL and L-LSP to the L output of your amplifier (and likewise for R).