"Wanna" and "gonna" are not words that you will find in a dictionary. They are just representations of sounds, the sounds we make when we say "want to" or ''going to" rapidly or carelessly. They are often used as a part of the shorthand that people use when texting.
Such writing is sometimes used when an author wants to illustrate certain aspects of a character by showing the way the character talks, epecially if the person had a unique dialect, accent or pronunciation.
Such words are not used in most writing.