Pain in back of my heel. Hurts when I go barefoot. Doesn't hurt when I wear heels. What is it and what can I do for this problem?

Heel pain. Consider plantar fasciitis, nerve entrapment, achilles tendonitis, bursitis. Wear good arch supported shoes, do appropriate stretching exercises as given by your orthopedic surgeon or foot doctor.
Achilles tendonitis. Or haglund's deformity. Doesn't hurt in the heels cause they are taking pressure off of the tendon. When you are barefoot the pressure is there again. Ice, stretching , eccentric excercises, physical therapy, sometimes a walking boot to rest the tendon.
Have it evaluated. Heel pain is most often caused by plantar fasciitis, a condition that is sometimes also called heel spur syndrome when a spur is present. Heel pain may also be due to other causes, such as, infection, tendonitis, arthritis, stress fracture, nerve irritation, retained foreign body, bone tumor, or a cyst. Have it evaluated by a professional and get the appropriate treatment.