Sore nipples are can indicate a couple of problems, ranging from an imperfect latch or even a yeast infection.
Some babies have some trouble learning how exactly to suck from the nipple. They might suck only on the nipple and not on the whole areola around it, or they might use their mouth in such a way that they are causing too much friction when pulling the nipple into their mouth. Going to see a certified lactation consultant or a lactation educator to sort out that latch can help. In the immediate time, you can buy Lanolin and put it onto your nipples after nursing each time. It does not need to be wiped off before nursing and can soothe cracked or sore nipples.
Occasionally breastfeeding babies can have a yeast infection in the mouth, which we refer to as thrush. When this happens, you might see white sticky stuff inside the baby’s cheeks that does not remove easily with a washcloth with water. For you, thrush can mean painful, cracked nipples! It is easily treated with an oral antifungal medication from your pediatrician.