Risk increases with time in the air. A flight of less than two hours may be free of risk unless it follows another flight of two or more hours or if you spent two hours in your seat waiting to take off. You need to activate the calf muscles enough to push the blood through the veins. Do it firmly and deliberately but not strenuously. If you are bothering your seatmates, you are doing it too vigorously.
Most experts say every two hours.
And if you have more than one risk factor, some doctors recommend doing it every ten minutes. Extend your legs straight out in front of you and flex your ankles, pulling up and spreading your toes, then pushing down and curling the toes. If there isn't room to extend your legs, start with your feet flat on the floor and push down and curl your toes while lifting your heels from the floor. Then, with your heels back on the floor, lift and spread your toes. Repeat this heel - toe cycle ten times.