Hello, Jean-Charles,
Great question!
"Close to" and "near" are synonyms. They mean the same thing and you can use them interchangeably in most cases.
"Next to" implies "at the side of." If someone sits down next to you, it means that the person sat down at your left side or right side of your body (instead of behind you or in front of you).
If you said that someone sat down close to/near you, the person could you at one of your sides or behind you or in front of you or (depending on your definition of "near") perhaps a few rows in front of you.
"He sat by me" could mean that he say next to you (at your side) or near/close to you. "By," though has another meaning -- if you say that someone has "stood by you" through a difficulty in your life, it implies a mental/emotional closeness instead of simply a geographical proximity.
I hope this helps!
Best,
Elizabeth