If a letter in the Tefillin is not recognizable, then the Tefillin are invalid for use. Examples include a "Yod" that was written too long, such that it resembles a "Vav," or a "Vav" that resembles a "Yod." Likewise, if a "Chaf" looks like a "Bet" or a "Bet" looks like a "Chaf," in these and similar cases the Tefillin are invalid. This applies regardless of whether the letter was initially written improperly or if some of the ink faded and it thus became misshaped.
Another requirement is that each letter must be "Mukaf Gevil" – entirely surrounded by blank parchment. This means that if two letters touch each other, even at just one point, the Tefillin are invalid, since those letters are not completely surrounded by blank parchment.
There is some discussion among the Poskim concerning the status of the inside of letters, such as the inside of a "Tav" or "Heh." The Shulhan Aruch first cites a view that if the parchment is punctured in the inside of a letter, the Tefillin are nevertheless valid, even if the perforation covers the entire area inside the letter. According to this view, the requirement of "Mukaf Gevil" applies only to the area around the outside of the letters, and not on the inside of the letter. However, the Shulhan Aruch then proceeds to note that from the Yerushalmi it appears that the requirement of "Mukaf Gevil" applies even to the interior of the letters, and thus if a piece of parchment is missing in the inside of a letter, the Tefillin are Pesulot (invalid).
As for the final Halacha, Hacham David Yosef, in Halacha Berura, writes that if a Sofer is writing Tefillin and notices a perforation in the parchment, he should write the letters around the perforation in order to avoid this Halachic debate. If, however, the puncture occurred or was noticed only after the letter was written, the Tefillin are valid, as long as the perforation does not cover the entire area inside the letter.
Summary: If a letter of the Tefillin is not recognizable, the Tefilin are invalid. If two letters of the Tefillin are touching one another, the Tefillin are invalid. If the parchment is punctured, the Sofer should not write a letter around the perforation, but if a hole is discovered inside a letter after it was written, the Tefillin are valid, as long as the perforation does not cover the entire inside of the letter.