Context is what surrounds a word or piece of text. Context can be used to understand words which people do not know the meaning of.
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.