What is the definition of the word "real"? For example, we can all agree that Harry Potter and unicorns are not real, while Mount Everest and Mars are real. Some people even say consciousness is not a real thing. What does "real" and "reality" actually mean?
There is no one canonical and privileged definition of 'real'. However, in the most intuitive sense, it is anything that is independent of us and our existence and immediately apprehensible. This is the real of naive realism. From WP:
In philosophy of perception and epistemology, naïve realism (also known as direct realism, perceptual realism, or common sense realism) is the idea that the senses provide us with direct awareness of objects as they really are.1 When referred to as direct realism, naïve realism is often contrasted with indirect realism.2
But the thing about 'real' and 'reality' is that there are a host of views on what it is. That means what 'real' means depends on the theory of realism of which there are many that explicates its meaning. Thus, some theories of real include, among other:
Thus, there is real in the context of ethical values, real in the context of mathematical figures, real in the context of empirical experience, and so on.
The other way to understand real is to understand it terms of what it is not. These theories are, thanks to Dummett, called anti-realism. Many physicists like to claim their definition of real is iron-clad, but a sizeable number of philosophers of science make solid arguments for instrumentalism. As such, modern mathematical physical claims to the sole valid interpretation of real are actually contingent of one's views about physicalism.
Paraphrasing Wikipedia on quantum mechanics, an object is real if outcomes of measurements of the object are well-defined prior to – and independent of – the measurements.
Considering your examples, Harry Potter is not real because there are various measurements which could be conducted on him, such as measuring his height, which are not well-defined by the text which establishes his existence. Similarly, unicorns are not real because various properties they are purported to have, like magical blood, are not measurable even in theory.
To say that Mars or Mount Everest are real is to say that, even though we have not measured every property of them, we could theoretically execute any definable measurement upon them; further, we don't expect those properties to change without physical cause.
"Cogito, ergo sum."
I think, therefore I am. The only thing we can readily depend upon being real is ourselves.
Of course, this is tremendously unlikely and raises a whole host of other questions, which is why you so rarely see actual solipsists. When you do encounter them, they tend to be somewhat... Unhinged.
Your question also opens more questions of its own. What kind of thing are we referring to when we say "real"?
Are we talking about conscious agents? People like you and me?
Are we talking about inanimate objects, like the bricks and stones of the world we seem to encounter?
What about qualia? Is "the taste of vanilla ice cream" real? Are love and hatred real?
What about abstract concepts? Are good and evil real?
Things get extremely fuzzy, far faster than we tend to anticipate.
"If a tree falls in a forest and no-one witnesses it, did it happen?"
Reality is that for which the answer is "yes".
Certainly a concept in philosophy exists for which the answer is "it cannot be proved". However that concept leads to the conclusion that nothing can be proved to be real, not even that which is witnessed by you personally. (After all, someone might have set it up to fool you.) In that case, all discussion of reality is moot, because no answer can be given. So any consideration of that school of philosophy in answering is pointless.
I am going to assume that you mean real in the scientific sense. Classically science observes phenomena, not things in themselves, noumena. So, it could be argued that science does not allow us to know reality, just to make predictions about its behaviour. Panpsychism proposes that the fundamental stuff of the universe is matter-consciousness, a noumenon. So we can know reality, ultimately. In the artistic sense, Harry Potter and unicorns are real. Consciousness is real, else what is answering this question? Stuff is real, and reality is made of stuff.
What is the definition of real?
Strictly speaking, the definition of "real" is, and can only be, an ostensive definition.
You ostensively define what is real by pointing a finger at what you think is real. We can all do it, and we all understand, including children and philosophers. There is no ambiguity.
More fundamentally, the brain is a cognitive system and as such has to work out some sort of representation of the real world, and so has to have a fundamental notion of reality. This notion can only come from within. In other words, brain is its own measure of the notion of reality because, if it exists at all, it is itself by definition its own reality. However, as a cognitive system, it is oriented to the outside. Our brain's function is to give us a representation of the world outside our brain. The reality we are interested in, if we are to survive in it, is the real world. Basic metabolism takes care of the survival of our brain, so what the brain needs to do is to help us survive in the real world. Thus, the most important questions for the brain to decide is which is real, which is not. This is what we spend our lives trying to establish. This is a task with no end in sight. We can only believe, not know, what is real.
However, this is not the question. The question is the definition of "real".
From the point of view of the brain, reality starts with itself. A sort of neurobiological Cogito: I think, therefore I am. This is the definition of "real". Reality itself may then be thought of as whatever the brain manages to include into what seems real in the same sense that it sees itself as being.
The first chunk of furniture that the brain normally comes to include into what it takes to be reality is what is immediately perceptible and stable, which are just concrete objects in the proximate environment of the subject. Subsequent experience of the real world, and in particular social life, leads the brain to extend the furniture to abstract objects, what other people want or think, the idea of human communities, and later perhaps the laws of nature and of logic. The brain extends its notion of reality further and further as experience makes it realise this and that aspect of the real world. We start from the most concrete, and we pack up a more and more abstract furniture into what we see as the container of the real world.
EDIT Subsequent experience of the real world, and in particular social life, leads the brain to extend the furniture to abstract objects By this, I mean the use of logic, not necessarily reasoning.
The brain is a logical organ and so it derives logical conclusions all the time (in an unconscious process) without the need for us to articulate any reasoning or to formalise each time the logic of the derivation. Few people ever articulate formal logic expressions, and providing reasons for what we do or think is at best occasional and perfunctory.
Each of us has inevitably his or her own view as to what is included in the real world, but we have all nonetheless the same fundamental notion of reality, because, ultimately, it comes down to the reality of what the brain perceives as itself, which can only be the measure of reality, and we presumably all have broadly the same sort of brains.
And this is an ostensive definition if anything is.
EDIT - This applies to dreams and delusions. We seem to take our dream for real while we are dreaming. It is only when we wake up that we can understand that this was delusional, but then we are no longer dreaming. Same for delusions.
Other people can only say that our dream or our delusion is not real because they are not having this dream or they are not now subject to this delusion. They would otherwise presumably take the same dream or the same delusion for real.