Yes. However be aware that it is very colloquial and informal and therefore shows either a familiarity with a person or that you are very enthusiastic and informal. With the wrong person, it might be considered disrespectful or sarcastic.
You would not generally say this to someone's mother, a judge, a priest or someone in a formal setting. It would better to say "You're welcome" in most cases.
Also, "You got it" can also mean "Yes I will" or "Yes" as a slang way of saying "You have got it right" which in this case has been shortened to "You got it."
Eg.
Q: "Can I count on you to bring all the beer?"
A: "You got it!"
Note: "You got it" is a slang and in a way also involves slightly incorrect grammar, however in colloquial speech with an enthusiastic or cool/confident attitude to the right kind of person in the right situation, it can be a cool thing to say. However, without the right lineup of circumstances, it can be a very uncool thing to say. Good luck.
