As demonstrated in the beginning of Phantom Menace, lightsabers can easily slice through or melt metal. Why didn't Luke just slice the feet or legs off the AT AT Walkers in The Empire Strikes Back?
Why he didn't
The most plausible answer is that he just didn't consider it. By the time of the attack on Hoth Luke had received essentially no formal lightsaber training, and had only owned the weapon for about 3 years. Compare that to Qui-Gon, who had decades of experience with lightsabers, and Obi-Wan, who had received extensive formal training. It's exceptionally plausible that Luke just didn't know what a lightsaber was capable of yet.
But what if he had?
I don't think it would have been as easy as you think. What you need to remember is that different grades of metal are used for different purposes.
The scene at the start of Phantom Menace shows Obi-Wan and Qui-Gon facing off against B1 battle droids, standard infantry units designed for mass-deployment. They're lightly armoured for mobility and cost-efficiency, and about as thin as a humanoid skeleton. A lightsaber cuts through them like butter, because they're not meant to withstand any serious resistance.
Compare to when Qui-Gon tries to get through the door to the command center. He can penetrate the door easily enough, but cutting through it requires significant effort. Once the blast doors are closed, it becomes even more difficult. The following gif shows the results of his efforts: the first bit of damage you can see on the inside of the blast door took Qui-Gon minutes to achieve,and the gif itself shows him putting his entire strength (And probably some of the Force) into one thrust, which succeeds in knocking off a panel about the size of a sheet of paper.
And that's the blast door on a space station. The worst firepower they would expect would be from a heavy-weapons turret.
The AT-AT was possibly the most heavily-armoured ground unit in the Imperial fleet. It was designed for large-scale tactical assault, presumably against heavily-fortified positions and the strongest turret emplacements you could put on land. The Star Wars Encyclopedia states that they were armoured with some of the heaviest Durasteel available, impenetrable to all but the most powerful artillery. Part of the trouble the rebels have with them on Hoth is that none of their guns, even the turret emplacements, so much as scratch their armour.
Leaving aside the issue of armour for a moment, look at the size of it:
This isn't an official image, but it illustrates the scale of the thing: that tiny black speck between its legs is Luke, hanging on by his grappling hook. I doubt he's as big around as the axle in the AT-AT's ankle joint. Even leaving aside the issue of the armour, trying to cut that thing down with a lightsaber would be like trying to chop down a giant redwood with a herring.
Although I have little doubt that a lightsaber could cut through an AT-AT's armour, it would take such a long time that it wouldn't be worthwhile.
I prefer to think that "cutting through matter of significant thickness and density" (as opposed to piping, handrails, or wrists) is something that didn't occur to the screen writers during the creation of the original trilogy.
Take the Bespin fight scene, toward the end when Vader and Luke step out into the big shaft. At that point, Vader misses Luke twice, hitting the wall to his right instead -- about the only time I can remember from the original trilogy where a lightsaber strikes something really solid. Vader's lightsaber glances off, there are some sparks, but the wall remains undamaged. There is no slash of glowing, molten metal, like when a lightsaber hits a wall in the prequel trilogy.
I.e., my explanation is that the effect of lightsabers on solid matter was quite different in the mind of Lucas et al. back when the original trilogy was being made.
Actually, the "old" way is much more consistent with the explanations on how a tiny device like a lightsaber could actually create such a powerful blade for a prolonged time, as given by the West End Games "Star Wars" RPG back then: The power of the blade is only actually used up when it strikes something. I.e., a feat like Qui-Gon cutting through blast doors would leave the lightsaber's power unit depleted in no time... something which I actually expected to happen when I watched Phantom Menace the first time...
Reviewing the AT-AT footage, there's another point... the pylons are massive. The "feet" are circular disks almost as tall as Luke himself, with virtually no hand- or foothold, and moving at significant speeds, let alone jerking quite violently on each step. Trying to scale one of those to get at the thinner "leg" while the AT-AT is moving is... risky, to say the least. Aiming his grappling hook at the underbelly -- which is moving at a constant pace and doesn't threaten to crush him on a failed attempt -- seems like the much smarter thing to do.
The sheer size of the AT-AT would likely make it difficult to sever the AT-AT's feet. Here's a screenshot of Luke as he is about to destroy the AT-AT:
As you can see, the feet and legs are very large compared to Luke's body. The AT-AT appears to have a bit of a weak point at the four connectors between the feet and legs, but even these are very large compared to Luke (they appear to be about as wide as he is) and he would probably need to cut through two of them to ensure the foot was severed.
Moreover, the AT-AT was moving so it would have been difficult for Luke to maintain his balance and apply force while cutting through the armor. Although Qui-Gon was able to cut through a blast door in The Phantom Menace he was able to do so on stable ground, and it took him considerable time to do so.
Luke destroyed the AT-AT by cutting into its underside and throwing an explosive inside it. The Wookieepedia article on the AT-AT notes a weakness on the underside:
The AT-AT also lacked armor covering on its underbelly, leaving the spot vulnerable to mounted guns or portable missile launchers. To remedy this weakness, AT-STs were usually stationed around the flank of the walker to ensure nothing was given a clear shot at the AT-AT's weak underside.
The weakness was significant enough to affect Imperial battle formation. It is entirely possible that Luke was briefed on this weakness before the battle, and even if not it would be a reasonable assumption that the underside was not as well armored. On the other hand, one would expect the AT-AT's feet to be well armored since they are critical to the AT-AT's ability to move and they are more likely to come under attack (e.g. by infantry armed with explosives).