I was thinking about a different possibilities for habitable planets. And I was wondering what actually causes a planet to be tidally locked? I am assuming it more than chance that the bodies rotation and period are the same. 

I started thinking what it would be like to be on a planet that circles a huge star, one that would take earth decades or even centuries for one year. Seasons would be the same for most of ones life etc. I can think of a lot of cool questions for that, but I then thought that maybe the planet would be tidally locked if the star was very large. So what are the things that go into a body being tidally locked? What causes it?