Vegetables are a culinary class of food. Unlike "fruit," "vegetable" has no botanical meaning. It is a purely culinary term. Most dictionaries define it something like "a part of a plant used for food," which isn't very helpful. Obviously apples, oranges, and grapes are not vegetables.
What is and isn't a vegetable is a rather vague question. It's basically any plant that isn't a fruit, but saying what is and what isn't a culinary fruit is just the flip-side of the same question.
Typically, vegetables are much less sweet than fruits. They are typically eaten as part of a main course with other vegetables and/or meat. They're often less colorful and are most commonly just green.
This site can hopefully help with drawing that line between fruit and vegetable, although I'll be honest and admit that there are some things like avocados that I'm not even sure about. I always welcome feedback.