Your doctor has determined that you have Hamstring injury. This could mean that you have injured either one of the muscles that comprise the Hamstring group or the tendons (the tough fibrous bands that connect the muscles to bone).
This is a fairly common, troublesome problem. World-class athletes, from many different sports, have been hobbled by this injury. As you are probably already aware, it is neither a trivial problem, nor is it easily ignored. You may also now be aware, it does not quickly or easily resolve itself.
It is well recognized to be one or me most stubborn of all the muscle/tendon injuries.

What Can I Do Now?

One can think of this problem as really two separate entities. The first is the Acute or early, injury to the Hamstring. It is often sustained by a sudden move, a missed step, overstriding while
sprinting or hurdling, sudden surges or sprints while cycling, especially up hills. The pain develops early, often immediately, after the causative event, and usually will cause a cessation of whatever activity is being engaged in at the time. Walking is painful, sometimes impossible and there is tenderness in a very localized region on the back of the thigh. There may, in severe cases, be a large bruise and swelling at the site of maximal muscular injury, that may develop even days later.
The second type of Hamstring problem is the more troublesome, Chronic Hamstring Injury. The exact mechanism of injury is much less well defined and the outlook for complete healing is much more in doubt.

What can one do at the stage of Acute injury?

The principles of immediate care of any muscular injury are appropriate to this acute type of Hamstring injury. Immobilize or splint the leg, use crutches or some form of support to assist walking, immediately apply ice to the area, using some form of compression, such as an ACE bandage to hold the ice in place, for at least 20-30 minutes. Do not apply ice directly to the skin. Avoid further injury to the muscle. You should be seen by a doctor or trainer within the first 24-48 hours after a severe injury of this type. Avoid aspirin and the aspirin-like anti-inflammatory medications during the very early stage of injury (6-12 hours), as there is often a moderate amount of bleeding around the injured/tom muscle and this may be worsened by taking these medicines immediately after the injury. Continue to use cyclic ice therapy, every 2-4 hours for the first 3-7 days after the injury. Continue to use the crutches and allow the injured muscle to begin healing for at least one week. Even if the pain is much better within that first week, avoid any recurrent stress, such as running, to the muscle, as the muscle is greatly weakened and relapse is very common.

Over the following one to two weeks, you can begin to gently stretch the Hamstring. Some authors suggest that icing the area, before gently stretching the muscle, is an appropriate way to prevent renewed injury in this early period. Stretch in the painfree range. Stretch 3-4 times; hold 5-10 sec, then rest. Ice after stretching. You will gradually be able to stretch farther as the muscle heals, to the point where it should be as loose as the uninjured side. Remember: all the muscles of the lower extremities must be stretched to maintain "balance" and prevent future problems. Check out the link to the stretching page of this site.

When the injury allows you to stretch, without increasing pain at the injury site, you may begin to very gradually start resistance strengthening of the muscle. The safest early exercise is done while another person is holding gentle resistance, allowing the muscle to contract slowly and painlessly. Repeat this, slowly, until the muscle begins to fatigue. Stop if pain worsens during any part of this exercise. Try to get to 3 sets of 30 repetitions.
Theraband, or elastic strap/tubing, is another good method of early strengthening. Refer to the illustrations linked to this site.
It is often wise to ice the muscle after doing the resistance exercises, to prevent renewed inflammation of the muscle and tendon. Do not overdo the resistance exercises, especially early in the course. Do only as many as it takes to the point where the muscle begins to feel fatigued Gradually increasing the speed of reps, then the resistance to the point where the uninjured and the injured muscles are equally strong. No sports or exercise routine that causes either sudden stretching or requires the use of Hamstrings as an integral part of the sport should be initiated until full strength and flexibility are attained Specifically, avoid sprints, uphill running, hurdling, step or slide aerobic routines, hill or sprint cycling, any "burst acceleration" sports, such as racquet sports, basketball, soccer, football, etc. In this early, rehabilitation phase, walking (on flat surfaces) and swimming are acceptable. Once full, painless leg/hamstring extension is attained and strength becomes nearly equal to the unaffected side, you may gradually return to sports, using the "You must walk before you can run" concept. That is: start by walking, then increase your walking distance, gradually (still no hills!), then stationary cycling, then treadmill running, then outdoor running. As all these levels are achieved and mastered, you can then begin running up shallow hills, followed by very short 1/2-effort sprints, intermixed with your other distance runs
The one thing to always remember is: only advance to the next level of activity after you have assured yourself that you can perform the present level without any renewed symptoms. Any miscalculation, or "rushing" of the schedule, because "I'm feeling almost back to normal", may cause a complete relapse, setting your schedule back to the very beginning and almost assuring a very long, frustrating process of rehabilitation, sometimes lasting years.
Again, it is important to remember: strength, as well as flexibility of the other muscles of the leg must also be maintained. Therefore, include resistance exercises of the Quads (thigh) muscles, Hip Flexors, Calf Muscles, and Glutei (butt muscles) in your daily routine
Some specialists suggest using a Hamstring strap, or some form of compression of the hamstring (such as an ACE bandage or Neoprene sleeve), while doing the rehabilitation exercises and upon restarting your sport.
The basic tenets of Hamstring Rehab and readiness to return to your sport are:

1.Muscle flexibility equal on both legs.
2.Muscular strength and endurance at least 90% of the unaffected leg.
3.Hamstring strength is 60-70% of the Quadriceps (front thigh) muscle.
4.No pain with activities.

What if the problem becomes "Chronic"?

This is the worst of scenarios. It is usually due to inadequate rehab of the initial injury, but may also be from a repetitive, minor injury causing an area of inflammation, which can be very frustrating to treat. This type of Hamstring injuries can last months to years, be refractory to Physical Therapy, Chiropractic, medications or cortisone injections.
The treatment of these long-standing, stubborn Hamstring injuries does not differ from the ongoing treatment that I described in the section on Acute Hamstring Injuries. However, the outlook for complete healing and painfree exercise is much less optimistic. One can expect many setbacks and a much slower progression to full activity. Some people are unable to return to a high level of the original sport due to chronically recurring symptoms.

Will I need Physical Therapy?

This is a good question. There is no set answer for all people suffering from a Hamstring injury as to whether they will require specialized Physical Therapy. In general, the types of athletes most helped by P.T. are those in the acute phase of an injury, especially if they do not have the benefit of a trainer or assistant to help with rehabilitation. Also, those people that require individualized instructions on the stretching and strengthening exercises will benefit from a short course of therapy.
The other group that may benefit, would be those that are having persistent symptoms, despite a serious trial of home rehabilitation.
If you feel you might benefit from a referral to the Physical Therapy Dept, contact the doctor that examined you.

When Should I be Rechecked?

For an acute injury, you should be examined by either a trainer or a doctor, within the first 2 days. You should then be rechecked in the next 2-3 weeks to assure that you are improving as expected and that the rehabilitation routine is going as planned.
For the more chronic injuries, a recheck every 1-2 months should be adequate, as the expected time to resolution is so prolonged.
For either type of injury, you should be rechecked if there is a significant worsening of the problem.