You have to place the Lordvessel to pass those gates.
You may get it from Anor Londo. Talk to Princess Gwynevere, get the Lordvessel and optionally join the Princess Guard covenant.
Check out a checklist and set of information when playing Dark Souls at smcnabb.github.io.
If you're a new player taking first steps into the world of Dark Souls, you may also want to check this strategy guide shared by Kotaku.com.