Depends on what parts or your hands are hurting.
If its wrist, with palm facing you, lightly pinch your wrist, forefinger on front of wrist thumb on the back.
Move your wrist backwards and forwards slowly.
If this causes discomfort you may be suffering from carpel tunnel syndrome where your tendon is rubbing or getting trapped in an inflamed carpel tunnel.
If the pain is primarily in the little and index fingers this may be a trapped ulner nerve.
This runs through your elbow, forearm and into your pinky and index fingers.
Symptoms range from general discomfort, to sharp stabbing or tearing pains in elbow, or forearms to mild irritation in fingers or "shaky hands".
Try not to perch elbows or wrists on the edges of tables.
If your keyboard slants upwards, lower it so that it is flat.
When not using the mouse, take your hand off it.
If you get any of the symptoms above it is important to keep your hands warm and cold conditions will further constrict the movement of tendons and put more pressure on nerves.
If its really painful a couple of ibuprofen will take down the swelling which causes discomfort otherwise atopic cases can be treated with mild steroids.