Right after your surgery, you will be seen by a physical therapist at least once (and often twice) a day. Exercises and movement to reduce swelling and pain and improve circulation and motion are often prescribed. When you go home, you’ll be given a home program to follow. The home exercise program will build on what you started in the hospital in terms of range-of-motion, strength, coordination, and endurance.
All indications are that you should follow those exercises (and expand upon them) for at least six months. For best results, continuing the exercises and advancing them as tolerated should be done for a full two years after a hip or knee replacement. Emphasis is placed on the hip abductor muscles (they help move the leg away from the body and stabilze the trunk).
Exercising once a day is the minimum. Twice a day is good. But incorporating a little bit of physical activity and exercise into each and every hour of the day is really ideal. Without overdoing it, you want to keep that joint moving and prevent the formation of any adhesions (excessive scarring).
Sometimes swimming can be very useful. The natural buoyancy of the water, the elimination of gravity and forces on the joint, and the warm temperatures make this an excellent treatment approach. A few days to a week after surgery, you’ll be able to do exercises (e.g., squats, step ups, walking without a cane or walker in the water) that wouldn’t be possible on land.