It depends on what you mean by "I got it". If you are referring to obtaining something (like an object) we won't use "I got it" in a formal situation. We might rather use "I have it."
For example:
Boss: "Where is the report?"
Employee: "I have it here."
Sometimes "I got it" may be used when referring to promotions.
For example:
Co worker 1: "What was the meeting about?"
Co worker 2: "The promotion, I got it."
However, this is still pretty informal we would most likely say something along the lines of "I was promoted".
"I got it" is also sometimes used to express understanding.
For example:
Teacher: "Would you like me to explain the structure again?"
Student: "No thanks, I got it now."
Here, you could rather use expressions like; I understand and I've grasped it.
So to answer your question, No we don't usually use "I got it" formally.