used in writing to represent the sound of the phrase got to when it is spoken quickly
The pronunciation represented by gotta is common in informal speech. The written form should be avoided except when you are trying to represent or record such speech.