UPDATE YOUR FIRMWARE FIRST
Before proceeding with any hardware "manipulation" I recommend you try the latest firmware. If you are running a stock ROM simply update your phone's software, and if you are on a custom pre-ICS ROM the update can be found here.
If the issues persist, keep reading.
You have to realise this fix does not solve the issue for everyone. So just to be clear, THIS DOES NOT SOLVE THE ISSUE FOR EVERYONE. The reason for this is simple - not everybody has the same issue. My opinion is that these issues have similar symptoms, but the causes are different. Similar issues could be caused by: a faulty charger, bad digitizer or SD card slot touching the cover.
The issue discussed here is related to a small silver pin located at the back of the phone (pictures below). That pin is the screen's "grounding" connection to the back cover. In time the pin loses proper contact to the cover and the screen becomes unresponsive. There is also a matter of static build-up which further complicates matters. I believe this is mostly down to the worst back cover in the known universe.
You could get this problem for no particular reason, but you might also experience it after dropping the phone, sneezing too hard, or when using an aftermarket battery (Anker, Chichitec, etc.) since they are usually thicker. If you have issues only while charging try a different charger. If you still have issues, this fix should help.
Note that there is more than one way to fix the issue, and that the results are not always instantaneous. The simplest fix is pulling the aforementioned pin outwards. The downside is the pin might bend back into its original position... So you could try applying one of the alternative solutions as an addition to pulling the pin.
Also, I am not responsible for your actions. If you damage your phone, it's on you.
What I'm doing here is sorting useful info and adding creative advice, I am not the one responsible for the actual solution. It's primarily tinky1, who started the first thread on the issue, where most debating and solving was performed. Then, misiek_to_ja (and his daughter ) noticed that using the phone without the back cover temporarily solves the problem. This meant the problem was beneath the back plate, which abrown0809 proved by pointing us to the grounding pin that everybody was somehow missing for two months. What followed were aluminium foil and soldering tricks that eliteone thought of. stuart0001 started a petition, but HTC ignored it. Andyjb103 pointed out that the firmware update can fix the issue in some cases. And there is of course everyone from tinky1's thread that went through loads of pain and suffering while testing different chargers, wall sockets, USB plugs, area codes, weather conditions, etc. A BIG THANKS TO EVERYONE!
First, the simplest way to fix the issue. Switch the phone off, remove the back cover and locate the silver pin shown in this picture.
Now pull it out a bit, like so:
Use a needle, a tiny screwdriver, or anything with a pointy end. Just be careful and don't pull too hard or too much. The side of the pin that is closer to the edge of the phone is the side you want do the most pulling to.
And that's it as far as the pin goes! Results could be instant, but there is still a chance you'll need to do a couple of things:
1. Discharge the phone all the way (until it shuts down).
2. Remove the battery and press the power button (as if you were trying to turn the phone on).
3. Leave the phone without the battery overnight (or for at least an hour).
4. Put the battery back and charge the phone without touching the screen.
Make sure you don't touch the screen whenever you're charging, until the issue disappears. This should happen within 2-3 days. If the problem persists, you ether did something wrong, or (as explained above) you have a different issue... Most common related problem is a faulty digitizer.
If the issue does go away you could make sure it stays that way by applying one of the alternatives as well.
See this small white square on the inside of the back cover?
That's where the silver pin makes contact to the cover. By pulling the pin out you insure better contact to that square. There are plenty of ways to further improve that contact.
Here is a few:
1. Take a small piece of aluminium foil (2cm by 2cm, or whatever works for you), fold it a few times and put it over the square (like this). Now carefully put the phone into the cover and make sure the foil doesn't move away from the square. If you want to keep the foil in place add a drop of superglue (just not directly on the square).
2. Alternatively, the foil could go directly on the pin. Stuart0001 made a picture of that here. This version is a bit more risky though.
3. Adding any sort of aluminium works (or any conductor for that matter). Take a look at what Oceanic72 did here.
4. Put a few drops of solder onto the square. And be careful with this one... Or just skip it if you've never soldered before. More on that in eliteone's post here.
5. Put some electrically conductive paint on the square. Michael_Mcr suggested that here.
There you go
If any of these solutions solve your problems but they come back, just try again. I do not recommend puling on the pin more than a few times though...
Hope I helped!