In Rudyard Kipling's poem, "If," the first literary device employed that immediately draws the readers attention is repetition. Obviously, repetition occurs when a word or phrase is used over and over again. However, it is not used casually on the poet's part, but for a specific purpose. It is referred to as didactic—"a work meant to give instruction." Furthermore...
The placement of the...poem...in the collection [Rewards and Fairies] serves to distill a specific lesson from the story for its young readers.
Knowing instruction is the poem's intent, we can also find the purpose of the device as described here:
Repetition is an effective literary device that may bring comfort, suggest order, or add special meaning to a piece of literature.
In this case, I would suggest that there are two things the repetition of "If" brings to the poem. The first is a sense of "hope." The word represents the potential for dramatic things to occur, including self-control, confidence in oneself ("courage"), honesty, open-mindedness, patience, personal integrity, and grace. These are many of the rewards described just in the first stanza of the poem.
If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too:
If you can wait and not be tired by waiting,
Or, being lied about, don't deal in lies,
Or being hated don't give way to hating,
And yet don't look too good, nor talk too wise
To take the advice given seems to promise a reward...
The poem (we find at the end) is directed to the speaker's son—and the hope is that "if" he can follow his father's suggestions, he will be rewarded in the most meaningful ways a boy (and his parent/s) could wish for:
Yours is the Earth and everything that's in it,
And---which is more---you'll be a Man, my son!
"If" the son can do all of these things, the world can be his, but more importantly, he will be a man. This does not refer to attaining a specific number of years (e.g., 21), but rather it infers (especially in that "Man" is capitalized) that the youngster will be a person of value, and one to be admired and respected by others, as well as himself—he can well be not prideful, but proud of his achievements.
The second aspect of the repetition of "If" is the sense that being used so many times, it also infers a wealth of opportunities to achieve this distinguished state of manhood. Potential, symbolized by use of "If," is seemingly endless. I would think the poet might mean that failing once does not make one a failure...if he (or she) continues to try.