Trance. Elves don’t need to sleep. Instead, they
meditate deeply, remaining semiconscious, for 4 hours a
day. (The Common word for such meditation is “trance.”)
While meditating, you can dream after a fashion; such
dreams are actually mental exercises that have become
reflexive through years of practice. After resting in this
way, you gain the same benefit that a human does from 8
hours of sleep.
(PBR 15, PHB 23)
This says how long elves must "sleep".
Long Rest
A long rest is a period of extended downtime, at least 8
hours long, during which a character sleeps or performs
light activity: reading, talking, eating, or standing watch
for no more than 2 hours. If the rest is interrupted by a
period of strenuous activity—at least 1 hour of walking,
fighting, casting spells, or similar adventuring activity—
the characters must begin the rest again to gain any
benefit from it.
At the end of a long rest, a character regains all lost
hit points. The character also regains spent Hit Dice, up
to a number of dice equal to half of the character’s total
number of them (minimum of one die). For example, if a
character has eight Hit Dice, he or she can regain four
spent Hit Dice upon finishing a long rest.
A character can’t benefit from more than one long rest
in a 24-hour period, and a character must have at least
1 hit point at the start of the rest to gain its benefits.
(PBR 67, PHB 23.)
The first paragraph limits long rest to no more than 2 hours light activity, so 6 hours of sleep, by inference.
Elves need only 4 hours of sleep, but the rule doesn't modify how long a long rest is, so the reasonable inference is that an elf might be able to take 4 hours of trance and 4 hours of light activity.
Note that a compelling argument can be made that the rule is 2 hours of light activity, and 4 hours trance... but the Trance rule doesn't allow for shorter rest times, only shorter sleep, and the long rest is already not 8 hours of sleep. Taking the 5E principles to heart, the exception is narrowly constrained... So the reasonable change is it's still 8 hours, 4 of which are trance, and any strenuous activity breaks the rest and prevents the benefits.
The DMG guidance is limited; it does note that monsters also need to eat and sleep.