I've elsewhere explained in detail why Hades is translated as 'hell' in this passage, which is important for understanding it. However, in the interest of not reproducing an entire answer, I will only repost the relevant portion here.
The distinction between the Greek terms γέεννα (Gehenna), ταρταρόω (Tartaroo/us), and ᾅδης (Hades) was somehow lost in translation into the Latin Bibles and later into English Bibles. The early Hellenic, Jewish, and Christian understandings of ᾅδης are thoroughly explained in my other answer. It is my recommendation that ᾅδης be transliterated ('Hades') rather than translated (as 'hell'). With that said, this is not intended as a reference to eternal punishment in this passage, but rather as a metonymy for 'the power of death.'1
The IVP New Testament Commentary further supports this idea that ᾅδης is a metonymy for 'the power of death':
The “gates of Hades” in the Old Testament (Job 38:17; Ps 9:13) and
subsequent Jewish tradition referred to the realm and power of death;
death itself would not silence the church. Against those who
presuppose that Jesus could not have planned the church, though he
chose twelve disciples as the nucleus of a remnant for Israel (compare
the symbolic use of twelve in the Dead Sea Scrolls), the language of a
“church” was already being used for a remnant community among his
contemporaries (Dead Sea Scrolls...).2
The translation would thus read,
And I tell you that you are Peter, and on this rock I will build my
church, and the power of death will not prevail against it.
This is a good dynamic-equivalent translation, but a formal-equivalent translation may be desirable (this is a subjective preference). For this reason, it may be preferable to translate it like so:
And I tell you that you are Peter, and on this rock I will build my
ekklēsia, and the gates of Hades will not overpower it.
Jesus was essentially saying, "Nothing can stop us! Not even death!"
1 cf. Biblical Studies Press, The NET Bible First Edition; Bible. English. NET Bible.; The NET Bible (Biblical Studies Press, 2006), Mt 16:18.
1 Craig S. Keener, The IVP Bible Background Commentary: New Testament (Downers Grove, IL: InterVarsity Press, 1993), Mt 16:18.