A line is a unit of text as it appears visually in a space, such as in poetry or formatted text, while a sentence is a grammatical unit that expresses a complete thought and is defined by its structure and punctuation.