The hamstring is a group of three muscles situated on the posterior thigh consisting of the semimembranosus, biceps femoris, and the semitendinosus. The gluteal muscles are superior and the popliteal space is inferior. Even though these muscles are very strong and durable, they are often injured or "pulled". This is a common injury in athletes due to the rigors of the sport.
Recovery time after injury to these muscles depends on the severity of the injury, the physical fitness of the individual, and the general state of health. When athlete's injure these muscles recovery time may be quicker because they are more physically fit than you or I, but it can also be longer because of the severity of the initial injury. Chances are that when we pull these muscles the extent of the injury is a lot less severe than when an athlete pulls them. Taking these factors into account, recovery time is highly individualized.
It depends on the severity of the injury, and also in part on the general health and nutrition of the person injured, and how well they care for the injury during rehabilitation. This is a very common injury in football and baseball, as well as others.
In general it can take quite a while to be completely recovered from a hamstring pull. It is a long, large muscle that is impossible not to use in some fashion if you stand or walk, so many times people re-injure themselves and prolong recovery time. A Grade 1 injury (least severe) can heal in just a few days with rest, ice, compression and elevation (RICE), whereas a Grade 2 pull can take 4 - 6 weeks. Grade 3 is the most severe and usually requires surgery and a few months of rehabilitation.