The most basic settings influencing the spacing are indent and
linewidth. They are set in the \layout block. They
control the indentation of the first line of music, and the lengths of
the lines.
If raggedright is set to true in the \layout block, then
the lines are justified at their natural length. This useful for
short fragments, and for checking how tight the natural spacing is.
The option raggedlast is similar to raggedright, but
only affects the last line of the piece. No restrictions are put on
that line. The result is similar to formatting text paragraphs. In a
paragraph, the last line simply takes its natural length.
This page is for LilyPond-2.4.5 (stable-branch).