Q:

What does the expression "right on the tip of my tongue" mean?

After googling, I'm not really sure what exactly it means. I have two conclusions:

It means that I don't remember an easy word or a name right now although I already know it and I was able to remember it any time in
  the past. So I'm like It'll come to me.

.

It means that I was about to say something but someone else said it faster than me. I didn't forget this something at all. I already
  remember it but someone said it before me.

Which one is correct? Is it about forgetting or speed?

A:

"I have a word right on the tip of my tongue" means I can almost recall it but am not able to do so. So, like in your first example.

If something that you want to say is on the tip of your tongue, you think you know it and that you will be able to remember it very soon. (Cambridge Dictionary)

In your second example, when you intend to say something, but someone says it before you, you can say:

You took the words right out of my mouth. (Thefreedictionary.com)

A:

To have something on the tip of (one's) tongue is quite aptly described at 

the free dictionary as Almost able to be recalled.

and at

the cambridge dictionary as
  you think you know it and that you will be able to remember it very soon

So, your assumption 1. would fit.

A:

"On the tip of the tongue" means you are about to say something but the words have yet to be said. It can be used in multiple ways, including in the sense of both of your examples.
From the Collins dictionary, 

"on the tip of someone's tongue" can mean
      1. almost said by someone.
      2. about to be said, especially because almost but not quite recalled.

Your first interpretation of the idiom involves the second listed meaning. The sense of not actually remembering how to express what you want to say is typical and probably the most common usage but need not always be the case.
The second interpretation of the phrase in the post involves the first meaning, but the connection with speed may be inherent if you decide to stop saying something that was about to come out of your mouth.
Some examples:

"It was on the tip of my tongue to say the same thing but you beat me to it!" - which shares the meaning of "You took the words out of my mouth",
"It was on the tip of my tongue to say something but  decided keeping quiet was a wiser choice."
"Oh look, there's an ... um ... err ... you know ... what do you call it? Its name is right on the tip of my tongue."

