Have you ever woken up 2-3 days AFTER your tough workout and been more sore than the day before? This is DOMS, delayed-onset muscle soreness, meaning your body is working overtime to repair the "damage" done to your muscles during exercise.
A lot of factors play into how sore you get--like going extra hard, trying a new class or working a new muscle group. Staying hydrated during and after your gym session is key and can help with the pain. Other ways to help ease the soreness is to stay active and keep your muscles warm even if its a good long stretching session or a brisk walk the next day.
Be sure you are getting enough protein in your daily diet as well, this helps repair and build muscles--that's the whole reason we're working out anyway right?! Try including a BCAA (branched-chain amino acid) during or after your workouts as well, these drinks stimulate protein synthesis which is key for muscle growth