The saying is that "bf shouldn't hurt" and for 99% of women this is true, but there is a small percentage of women that even when everything is fine with the latch, it's still not 100% pain free.
With DS1 the "pain" lasted for 6 long weeks, then one day I woke up, latched him on and it just didn't hurt anymore. DS2 is a bit of a different story all together, it took him about 8 weeks, even though my latch was fine.
There are some "hard and fast rules" that can help, but most women need at least a few days for their nipples to adjust to being sucked on at each feed, every couple of hours. If you have pain, and are worried about the latch, etc then speak to a lactation consultant for advice. Even when the latch is spot on, for some women (including me), they reach a point (usually about week 3) where they start to dread each feed and this is when alot of them tend to switch to bottle feeding. I just fed through it and life became so much easier once milk supply was established and bubs wasn't feeding as often.
There is help available though, and there are things you can do so bf does become comfortable, but how long it takes usually depends on the individual woman.