The earliest reference to the two gates comes from the Odyssey, in which Persephone recounts a dream that Odysseus, her husband would return:
Stranger, dreams verily are baffling and unclear of meaning, and in no wise do they find fulfilment in all things for men. For two are the gates of shadowy dreams, and one is fashioned of horn and one of ivory. Those dreams that pass through the gate of sawn ivory deceive men, bringing words that find no fulfilment. But those that come forth through the gate of polished horn bring true issues to pass, when any mortal sees them. But in my case it was not from thence, methinks, that my strange dream came.
-Homer, The Odyssey, book 19, lines 560-569, Loeb Classical Library translation (via Wikipedia).
The Loeb translator, in a note, comments that "The play upon the words κέρας, 'horn,' and κραίνω, 'fulfil,' and upon ἐλέφας, 'ivory,' and ἐλεφαίρομαι, 'deceive,' cannot be preserved in English."
The gates also appear in Virgil's Aeneid, in which the hero, Aeneas, returns from the underworld by way of the ivory gate, which gave classical scholars a lot of room for interpretation. It seems to me that Virgil is cautioning the reader about the veracity of his story. Wikipedia uses the Dryden translation of Virgil, most likely because it's in the public domain. But it's also simply beautiful poetry. Aeneas, after visiting his dead father in the underworld, returns to the living world with the Cumean Sibyl:
Two gates the silent house of Sleep adorn;
Of polish'd ivory this, that of transparent horn:
True visions thro' transparent horn arise;
Thro' polish'd ivory pass deluding lies.
Of various things discoursing as he pass'd,
Anchises hither bends his steps at last.
Then, thro' the gate of iv'ry, he dismiss'd
His valiant offspring and divining guest.
-Virgil, The Aeneid, Book 6, lines 893-898, tr. John Dryden
The gates of horn and ivory have turned up in modern literature, most notably in Robert Holdstock's novel Gate of Ivory, Gate of Horn in his Mythago Wood fantasy series.
And of course the myth of the two gates gave the name t0 the Chicago folk club, where Odetta, Bob Dylan, Bob Gibson, Hamilton Camp, and virtually every other prominent folksinger of the 1950s and '60s performed.