There is not exactly a setting in the poem other than that of the father giving advice to the son. In the poem itself, there is nothing to indicate when or where the poem is being written.
But if you think about Kipling's overall political views and the time when this poem was written, you can think about setting in a different way.
In that sense, the setting for the poem is a time when the British Empire is losing its grip on power. Kipling is trying to advocate that people should go back to the kinds of values that, to him, made the Empire great. These are the values he advises his son to hold on to in the poem.