What does Sherlock mean exactly when he says "I'm not a psychopath, I'm a highly functioning sociopath"? What is the meaning of this line ?
While the medical use of the terms are interchangeable, most people in common language use them differently:
(The "high functioning" part is a red herring, sociopaths function really well and run companies etc. You usually see "High Functioning" paired with Aspergers or Autism, not Sociopath. But whatever.)
Sherlock isn't really a sociopath since he helps people all the time, while pretending he's only doing it because he enjoys the puzzle or the game. In fact in this very episode, his motivation for the act that follows the line,
is to help another person. That said, the line is "in character" since he likes to pretend he doesn't care, and he is able to do things without a qualm that most of us would not do.
Knowing the original stories and many adaptations, I'm 99% sure, that Sherlock is a high functioning Asperger's, he's NOT a sociopath- it's only the BBC series' writer's fantasy.
'Sociopath' and 'psychopath' are the SAME thing, only different areas of medical and psychological research and different countries used different terms.
While I have to defer to the many posters who have greater knowledge than I do of how the terms should be used, I think these are the meanings intended, which would make the distinction Sherlock draws make some sense:
A sociopath is someone who lacks empathy. They are aware of their own emotions, but tend to be oblivious to what others show themselves to be feeling, or would obviously (to a non-sociopath) be feeling. (For an example, see "A Study in Scarlet", where Sherlock protests that surely, a woman wouldn't still be upset about a child of hers who died years ago. When he says it, he can deduce immediately from the reactions of the others that what he's said is not only wrong, but grotesquely wrong from the perspective of those who do have empathy - but it's a deduction, not because he suddenly understands the bond between a mother and child.) A sociopath who is "high-functioning", as Sherlock claims to be, is presumably one who can navigate acceptably well through social situations, by using deduction as a substitute for the ability to imagine themselves in another's shoes.
A psychopath, by contrast with a sociopath, doesn't even want to navigate acceptably through social situations - if he says things that are grotesque and horrifying to other people, what does he care? It doesn't make him feel bad, so why would it matter to him? If he has to balance between "this would give me a good chuckle" and "this would leave the other person traumatized, crippled, or even dead" - well, it's a no-brainer, isn't it? It would bring him amusement, and he won't feel anything seeing the other person's pain - heck, maybe he even gets fun from witnessing their pain.
When Sherlock snaps that he is a high-functioning sociopath, not a psychopath, he's doing so in response to the female cop's insinuation that someday he'll switch from solving crimes to committing them. There are many possible explanations for why he might be so annoyed by the suggestion. A strong possibility, however, is that he's irked that she misunderstands his tastes so badly. To suggest that he is a psychopath suggests that he's that easily entertained.