After the Carpal Tunnel surgery, your hand will go through a period of immobilization or at least mandatory rest to aid recovery. To regain your strength and flexibility of the hand and to prevent the Carpal Tunnel symptoms from returning, you will need to perform some stretching and strengthening exercises.
You should aim to start these exercises as soon a you can do them pain free. when The pain occurs, rest and go back to simpler exercises. Initially, the goal should be to restore the full , pain-free range of motion at the joint. Later, you can perform static strengthening exercises and progress towards dynamic exercises with weights or resistance bands.
Wrist Stretch Warm-up
Make a fist with both hands, keep your elbows bent and then bend your wrists down as far as you comfortably can and then bend them up as far as you comfortably can. It looks like you are revving a motorcycle up. Do only 5 or 6 repetitions and go slow. Focus on stretching the wrists.
Same exercise as above, but this time keep your palms open. In this way you'll feel the wrists stretching even more.
Put your palms together like for a prayer and then, while keeping the palms together, bring your elbows out and your hands down. Don't over do it if it feels painful. Aim for a bit of progress every day but do not over do it.
Bend the wrist forward (your fingers will be pointing down) and with the other hand grab the fingers and apply some pressure.Keep your elbow stretched during the exercise and aim to hold the stretch for 15-20 seconds. Then bend the wrist with the fingers pointing up , grab your fingers with the other hand and hold the stretch for 15-20 seconds. Don't forget to keep the elbow stretched.
Wrist Extension with Dumbbells
Grasp dumbbell with overhand grip. Support your forearms on a bench or lap, wrist of working hand just beyond edge of bench, palm facing down. Bend wrist. Extend wrist as high as possible. Return and repeat. Continue with opposite arm. See here and example.
Wrist Flexion With a Dumbbell
Same as previous exercise but the palm is facing up. Here you can see a short video.