Context in language is what surrounds a word or piece of text. In order to understand what words mean, we have to know something about the situation where they are used. In print, a word, phrase or sentence has other text around it. This helps the reader to understand the piece in question. In speech, the social setting as well as the language help the listener to understand what is said.
Something like: "You can take it whenever you need to" might refer to almost anything. However, if it is said by a doctor to a patient, then the context is clear, and the listener can guess it refers to some kind of medication. So the context is what goes with a text (written or spoken) which helps the reader (or listener) understand the communication.
However, to understand what is really going on, we may need to go beyond what is said or written. A simple phrase, such as "I hate you" can mean exactly the opposite. All kinds of clues are needed to understand what has been said. Along with verbal communication comes non-verbal communication.