Hi,
It's short for I've got you. got you can be pronounced quickly as gotcha.
'to get someone' can have a number of meanings. It often means 'I have an advantage over you'. eg
When a policeman captures a robber, the policeman might say 'Gotcha'.
or When I make the winning move to beat you at chess, I might say 'Gotcha'.
If you look at it from the opposite point of view, the robber might say to the policeman, 'You've got me'.
Best wishes, Clive