How long will sex hurt?

I had sex only two times  in my life, and both hurted a lot! Is that normal? When will it stop hurting? Is there a way for it to stop hurting!?