"Got it" means "I understand." You say this when someone is giving you instructions or teaching you something:
A: That piece goes over here like this, and this piece screws into the top.
B: OK, got it.
You can think of "Got it" as a shortenened version of "I've got the idea (of how that works / of what to do / etc.)"
"Got it" is more casual than "I understand." So, for example, you would use "I understand" if you were being yelled at by your boss for doing something wrong:
A: You should not have done that without checking with me.
B: I understand.