Hitler was expecting an invasion somewhere on the coast of north of France. So why didn't he have more submarines there that could torpedo the invading allied fleet when they were crossing the channel?
The English Channel is too shallow in many places to be safe for U-Boats. The operating depth for the Type VII submarine was up to 230 meters, while the English Channel is only 45 meters deep in many places.
In a confined channel such as this a U-Boat's only defence against air and surface attack is to dive quickly, to an unpredictable (but deep) depth. Unknown, because its fate is more uncertain if the depth charges used to attack it are set to the actual depth of the U-Boat.
Note that the kill radius of a depth charge is only about 4m, and the disabling radius of one is only about 10m. In a waterway only about 45m deep a depth charge set to go off at 30-35m covers half the possible escape depth, while the actual height of the U-Boat covers another 20% of that.
In addition to the other answers, WWII submarines were primarily surface vessels which could submerge for combat. They had very limited speed, visibility, and battery range underwater. The batteries took a long time to recharge, and they had to be on the surface for it. Limited visibility made it difficult to spot their prey. Limited speed limited their patrol area and made it difficult to catch up to a target. As a result, they spent most of their time on the surface.
Even underwater, submarines are quite visible from the air, especially in shallow water or at periscope depth. They'd be quite vulnerable to overflying aircraft. Being so close to Britain, and with Allied air superiority, and in such a narrow area, they'd encounter many ASW (Anti-Submarine Warfare) aircraft, and be forced to dive limiting their speed and visibility and draining their batteries. Even underwater, they'd be vulnerable to attack from the air. Or the ASW aircraft can keep the submarine spotted and vector in surface ships.
The Germans didn't know when the invasion was going to happen and would have to keep submarines in the Channel for weeks. This would leave them extremely vulnerable to all of the above. It's a nightmare scenario for a U-Boat captain.
When the invasion did come, what would the U-Boats do? This was at a time when the Germans had already lost the Battle of the Atlantic. The Allies had beaten the U-Boat, and the U-Boat was vulnerable. Any invasion fleet would be heavily escorted by normal warships, as well as dedicated ASW ships and aircraft. An enemy submarine approaching such a fleet would be suicide. If they got a shot off, they'd be pounced upon by aircraft and escorts.
For a similar and more detailed answer, see Why didn't Germany blockade the Strait of Gibraltar during WW2?
Other answers have explained why basing the U-boats in the English Channel was a poor idea for the Germans. Here's what actually happened:
In spring 1944, most of the U-boats were based in the ports of the Bay of Biscay, where they had easier access to the North Atlantic than they would had they been based in the Channel ports. On June 6th, all seaworthy U-boats in port were ordered to go into the Channel and attack the invasion fleet.
This had been anticipated. Every square yard of the area of sea between Cornwall and Britany was being scanned by anti-submarine aircraft with radar every fifteen minutes, day and night. This was a huge effort for the Western Allies, but it worked. Diesel submarines have to surface for air, or snorkel, regularly, and they could be detected by radar when they did so. Their submerged range wasn't adequate to get past the aircraft, especially since they weren't aware of the limits of the patrol area.
Very few submarines made it into the invasion area, and few of those accomplished anything.
Source: Tarrant, V.E (1994). The Last Year of the Kriegsmarine. Arms and Armour Press. ISBN 1-85409-176-X.
Addendum: u-boat.net shows two U-boats lost on 7th June, one of them definitely in the area; three on the 8th, two of them in the area, one on the 10th in the area, one on the 18th south of Guernsey, and one each on the 22nd, 24th, 25th and 30th June. There would not have been a large reserve of U-boats ready to sail, so this is likely a large fraction of the ones that went to oppose the invasion.
Submarines are most effective against unarmed merchantmen, preferably on the open sea with few or no escort vessels, and fewer aircraft in the general area.
The English Channel was "covered" by the greatest concentration of Allied warships and aircraft. An all-out battle in the confines of the English Channel would not have allowed the subs sufficient (lateral) "space" or depth to operate effectively.
Instead, it would have been a "killing ground" for the Allies against the submarines, without the chance for the subs to inflict commensurate damage on the landing ships. Submarines had their best chance in the middle of the Atlantic Ocean, where land-based aircraft could not reach.
It would have been quite a waste for u-boats to simply hang around in the Channel waiting for an invasion (bear in mind that the Nazis didn't know exactly where an invasion would land - the Allies performed a remarkable disinformation campaign and the Germans expected it further east - even possibly Norway).
Two reasons: first, the U-boats were most effective as commerce raiders. Since many convoys and ships steamed into ports like Bristol, Liverpool, Glasgow, Newcastle, and avoided the Channel, stationing more U-boats in the Channel would simply allow the Allies to deliver more war materiel into Britain.
Second, the Channel was extremely well covered by air and torpedo boat patrols from southern Britain. U-boats typically sailed on the surface, or just below, and were quite visible to overflying air patrols. The Royal Navy also maintained a strong presence around the Channel and North Sea.
It was safer for U-boats to hunt convoys out on the open ocean away from the British coastal defence.
The German submarine command focused primarily on sinking unarmed targets. Lots of their crewmen died just doing that. They knew that even fewer men would survive a submarine deployment if they were actively seeking British and American warships.
Numerically, there was not a good way to attack the British fleet in the Channel. Never has a flotilla of submarines attacked a fleet of ships, much less the heavily-armed British in their territorial waters. I am under the impression that even a well-timed submarine crushing blow to the UK would have amounted to very little in the (primarily) ground wars going on in the Soviet Union and
If the Germans sent one or two submarines to harass the British in the Channel, would that have the desired effect of diverting British resources to ... a few miles from their coast? No. The better way to harass the British and divert their resources was by raiding vessels in the middle of the Atlantic with an inexpensive vessel and small crew.
So when I narrow it down, I see that direct attack is virtually unheard of. Harassment in the Channel seems to be almost pointless suicide. The only thing left that I can see is reconnaissance. The only thing I have to say against that idea is that the Germans likely saw using a submarine for reconnaissance a waste of resources when the danger was high. A midget submarine would have been more appropriate for that; not the huge WW2-era boats that made up the German submarine fleet.
And finally, the UK had four major islands in the Channel... Guernsey, Sark, Jersey, and Alderney. The UK decided to pull out and leave them undefended. The Germans eventually occupied the islands after France was overtaken. These were only supplied by minor vessels which crossed from Normandy to the islands. I am not aware of any German naval ship visiting the occupied islands. Most of the occupation was supported by cargo ships and the Luftwaffe.
WWII submarines were very vulnerable to air attack as they were only lightly armed and armoured and could not spend long periods of time submerged and even less time submerged at depths great enough to reliably escape detection and attack. They also took some time to submerge from the surface and so any U-boat caught on the surface by an aircraft or warship as in serious trouble.
Indeed a large proportion of the casualties caused by U-boats were in the Mid-Atlantic gap an area out of range of submarine hunting aircraft.
Throughout all of the war Britain has air parity of not outright superiority over the channel. This is exacerbated by the fact that it is a pretty small area of water. Submarines need bases and any bases on the channel coast would have been extremely vulnerable to attack by air, warships and commando raids. Even at its widest points the Channel is pretty narrow and with Britain enjoying clear naval superiority throughout the war it is pretty easy to cordon off.
U-boats relied on stealth, ambush and surprise to be effective, even then they were only really effective against lightly armed vessels in such a small area they could easily be bottled up and wiped out.
In addition the real value of U-boats was in disrupting freight between Britain and North America as well as the considerable material damage this caused it cost the allies naval and air resources to protect ships directly and to patrol the vast area of the North Atlantic. For obvious reasons there was no bulk freight between Britain and Europe (prior to the invasion) so the only possible utility of U-boast in the channel was to stop an invasion at which point it would be relatively easy for the Navy and Air Force to sweep them out in any case.
They key point here is that while U-boats could be very effective in ambushing merchant vessels in the open sea where they could pick their moment to attack and where military escorts were stretched by the sheer volume of ships and lengths of routes they had to protect they would stand very little chance in the face of a concerted invasion across a narrow body of water.
Not sure of the timings, but towards the end of the war Bletchley Park (Station X) had broken the German naval enigma, if memory serves me correctly this had 4 rotor wheels rather than the 3 of the Luftwaffe and German army enigmas, so the British actively sent U-Boats to killing grounds(1).
As a side note, German commanders at this point had realised that the enigma had been cracked (2) but due to the fact that Hitler was (probably) quite insane by this point, their sense of preservation overruled the military need to develop a new code. As Hitler, as I understand it, had assumed total command of the armed forces. This is evidenced by the fact that the German Panzer divisions, which were based in the Pas de Calais region around 6th June, could of been shipped to the Normandy area in time to slow the invasion. However Hitler was sleeping at the time and no one dared wake him to issue the order.
With regards the classification of subs, at this stage of the war the Germans were quite likely converting existing subs to AA subs to protect existing resources.
(1) If I remember correctly this was from a BBC programme about Bletchley Park (2) will need to find the title of the book.