Firstly, the pain you feel is 'delayed onset muscle soreness' (DOMS).
"Delayed onset muscle soreness (DOMS) is a common result of physical
activity that stresses the muscle tissue beyond what it is accustomed
"Regardless of whether you're sore, there are still improvements
occurring in your muscles during exercise."
It is a very controversial subject - you will find people form very different opinions on the matter. I feel the main reason for this is due to the fact that everybody is different and sometimes people feel that their own way is the only way.
One common misconception is that DOMS is a sign of a good workout. While it is true that DOMS shows that you have had a decent workout, it actually has little to do with how good a workout was - it is entirely possible to have a good workout without DOMS. If you are progressing, maintaining, and not losing strength in your lifts, your workouts are most likely good.
DOMS is not always a reason to skip a workout, as I mentioned everyone is different, everyone produces different amounts of testosterone and people have different recovery times. You have to listen to your body – it will take time to correctly figure out how to listen to your body but it’s the only way to get an accurate answer for how many days rest you personally should take.
As a general rule of thumb people say you should rest for about 1 week per body part but then others also say you only need about 48-72hrs for a major muscle to recover and be ready for a full blown attack on it again. Find out what works best for you and go with that.