Time of healing after scaphoid surgery, screw and one pin, and cast. What kind of exercise should I do with my hand while in cast?

8-12 weeks. Depending on the age of the fracture, fracture position, your health, this fracture with surgery can take 8-12 weeks to heal. Sometimes longer. Ask your doctor about exercises - at the very least moving the fingers for light activities is encouraged -.
Talk to surgeon. Scaphoid surgeries are notorious for troubled healing ask your surgeon.