You can use any filename extension, but if you do not use the recommended extension, you may need to manually specify what output format you want. See Invoking lilypond-book for details.
Lilypond-book automatically selects the output format based
on the filename.
produces html output
produces texinfo output
produces latex output
This page is for LilyPond-2.4.5 (stable-branch).