Threads get locked if they have already been put up, such as, Halo vs CoD. Or if the thread no longer has conversation and becomes old. I believe they also get locked if people complain and misbehave.
They can also get locked if there's no real discussion in it. Starting a thread just to show people a picture of your new pretty pink bike, for example, would give you a lock pretty quickly.
In other words, you do bad, your thread gets locked.
Your thread also gets locked if you are repeating a post. Like if another person already has the thread ''God vs Science'' and you start the same topic they will lock your thread real quick.
I think this has been sufficiently answered for now. If not, there's a ton of help pages, most of which originate or are linked to from the Newcomers section (see the bolded threads up top).