I pulled a muscle in my shoulder while opening a file cabinet. Generally how long does it take for this injury to heal.?

Depends. This would depend on your acute treatment, how quicly you normally heal, if you took any medications and how well you protect the injury till healing. Most strains and sprains will essentailly resolve (of this type) in a week or less. You could have more injury than you think and this can be typical of a torn rotator cuff. Minimal activity causing major complicaton. Ice, ibuprofen, rest, b seen.
Fast Healing. A sprain is when a ligament or tendon is injured by overstretching. There may be minimal or quite a bit of damage to it. Inflammation (redness, warmth, tenderness, and swelling) occurs as a natural healing process. The key is to minimize further damage while keeping the area flexible and mobile. Ice massage (first 24-36 hours), gentle range of motion, motrin/advil are the keys to maximize healing.
Depends. If it's just a pulled muscle, should be better in 1-2 weeks. If you have anything more like tendinitis or a tear of the rotator cuff, it could take longer and would do better with treatment. If not better in a couple weeks go see your doc.