Infinity was a mathematical and philosophical concept of having no end.
In 2268, a disembodied Spock remarked that his body seemed to stretch into infinity. (TOS: "Spock's Brain")
In 2365, William T. Riker described the sight of a hole in space as being like looking into infinity. (TNG: "Where Silence Has Lease")
In 2367, following a dramatic increase in intelligence, Reginald Barclay and a hologram of Albert Einstein discussed infinity. (TNG: "The Nth Degree")