It's because of the vocative case. As well as the a + lenition (the word given to the h added at the start of the word there), masculine nouns get an i at their ending. This is called slendarisation as i and e are slender vowels in Gaelic (A O U are called broad vowels).
Wikipedia sais that the vocative case is used for a noun that identifies a person being adressed.
It's based on formality. Generally for anyone older than you, of a higher authority, or strangers you should use ''leibh,'' whereas familiar people or those younger than you would be ''leat.'' Since they say boy the person is probably younger than the speaker so "leat" is more appropriate.