(Mainly) Iambic Pentameter
Kipling's "If" is written in iambic pentameter, that most famous of English meters. You may have encountered it already in your literary travels, but if you haven't here's a quick run-down:
A line of iambic pentameter consists of ten syllables, divided into five groups (or feet). Each foot consist of an iamb, or an unstressed syllable followed by a stressed syllable. An iamb produces a rhythm like daDUM. Just check out line 2:
Are losing theirs and blaming it on you.
Here that daDUM daDUM daDUM? There you have it: iambic pentameter.
Now, if you take a peek at the other lines in the poem, you might notice a pattern. All of the even-numbered lines (2, 4, 6, 8, 10, etc.) contain 10 syllables and are textbook iambic pentameter. But what about the odd-numbered lines (1, 3, 5, 7, etc.)? Let's look at line 25, for example:
If you can talk with crowds and keep your virtue.
Notice, that everything is cool up until that last word, "virtue," where we have what appears to be the beginning of another iamb but… poof, we're on to the next line. Intriguing, to say the least.
Okay, don't get too worked up now. This is perfectly okay. The odd-numbered lines have an extra syllable. There are many fancy terms for this oh-so-peculiar phenomenon. Sometimes the syllable is called "extrametrical," sometimes "hypermetrical," and, when people want to be really fancy, they will call the whole line "hypercatalectic" (that's hi-purr-cat-uh-lec-tic). There are all sorts of reasons why a poet would want to add an extra syllable. Maybe Kipling started writing and realized that line 1 had an extra syllable and decided to roll with it. Maybe he had more to say in the odd-numbered lines. Maybe he just wanted to change things up. These are all good reasons, and we will never know for sure why the odd-numbered lines are hypercatalectic.
We can speculate about its effect, however. To do that, we have to talk briefly about the poem's rhyme scheme. Every stanza (except for the first, but wait just a second on that) has the following rhyme scheme: ABABCDCD, where each letter represents that line's end rhyme. This means the first and third lines rhyme, the second and fourth, etc. Each stanza contains four different groups (ABCD), and everything fits into a neat pattern. The alternating rhyme scheme, and the alternating metrical scheme (one line with an extra syllable, followed by a line with no extra syllables) stress the importance of pairs, of twos, of sequences. In a poem that is all about consequences—if you do x, then you will achieve y—this is a very important formal set up. It's the poem's way of making the nuts and bolts of poetry (rhyme, meter) display the poem's message—nifty.
Okay, now before we conclude, we have to talk about that pesky first stanza, which has the following rhyme scheme: AAAABCBC. Yeah, we know this is a little odd, not to mention unoriginal (Kipling rhymes "you" with… "you" three lines in a row). In a poem that is so balanced (4 octets, or eight-line stanzas) with strict meter, the first stanza is like a sore thumb that sticks out. Okay, so why put a sore thumb in the poem then, Mr. Kipling? Simple: this poem is about the uncertainty of life—money is lost, people turn their backs on other people, stuff gets destroyed. In a poem that is partly about how life throws you curve balls, the first stanza actually makes sense. It is the poem's curve ball, the poem's way of, again, displaying one of the poem's major themes.