It usually means either:
(1) Gotchya! You have been tricked. I have fooled you.
For example, If I pretend I'm pregnant, then I say April Fools! I had you believing my prank for a minute!
or
(2) I had the game in my hands, I had you defeated, but I let it slip, and now I might not win this game. For example, when playing chess, if I am capable of winning but I miss my opportunity. Or, for example, in Jiu Jitsu sparring, if I can break your arm but I decide not to, I could say, I had you there! And I would hope you admit defeat, instead of pretending it was a draw.