It didn't the first time

When me and my boyfriend had sex for the first time it didn't hurt at all. But recently when we tried again it hurt so bad to the point where I was bleeding and had to stop. What's going on?