Any iPhone / iPad / iPod touch purchased in the US, Canada, and some other countries will automatically display the time using the standard AM / PM time format. But you can make your iOS device show instead "military time", the 24-hour time format. Instead of "4:40 PM", it will say "16:40" (see screenshot).
To customize the time format you use, click on the Home button and launch the Settings app (gear icon). If needed, go back to the first setting "screen".
Scroll down until you see the General options, in the fifth group of settings: tap on it, and select "Date and Time" on the next screen. "24-Hour Time" is displayed first, and disabled by default. Tap on the toggle switch: notice the screenshot's clock at the top, right before I set my iPhone to military time.
As soon as you change to military time, the iPhone clock at the top will be updated to use the 24-hour format. But this doesn't stop there: once you've made military time the default, it will be used wherever hours and minutes are displayed. The mail app, where messages' timestamp are shown in the folder, your calendar, the time shown next to SMS texts or iMessages, etc.
Bonus Tip: if you're just switching to military time, here's an easy trick to understand how it works. Any hour after noon, instead of using PM, has 12 added to itself: 1pm becomes 13 hours. Any time before noon is the same as before: "9:00 AM" will be displayed simply as "9:00". The only difference is that the "AM" suffix is dropped by the clock. And midnight is "zero hours" ("0:00").