Actually, discourse is often used in comparison with text. Text is in fact, an actual spoken or written data, whereas discourse refers to whole act of communication including comprehension and production, however not necessarily and entirely verbal. Thus, discourse could involve the matters like background information, context and knowledge shared between the speaker and hearer. Also, it is not the study that people speak individual words, but a language used to explain the aspects of world. So, if you see any such details in a text then it is a discourse, otherwise a simple text.