Was it a new alternator or an overhaul/exchange?
First things first. Before the alternator is replaced, make sure the existing unit is deficient. Just throwing money at the problem can get expensive and frustrating.
Disconnect all the sparkplug leads. Disconnect the field wire at the alternator or regulator. In a 172M you can just pull the connector assembly off the regulator. The field wire in it is the F wire, on your far right as you're facing the firewall (pilot's side). Put an ohmmeter between that wire and ground at the firewall. You should see 3 to 5 ohms there. If it's higher, put the ground lead on the alternator case, on one of the ground studs. Check again. If it's 3 to 5 ohms, there's an alternator grounding problem. Not too common unless the engine ground strap is bad, and then you'd see poor cranking. If it's more that 3-5 ohms, turn the prop forward and see what the meter does. If it jumps around and varies a lot, the overhauler or factory put way too much grease in the alternator's rear bearing, and that grease gets extruded out when the rotor shaft goes in, and it ends up on the slip rings and brushes, the stuff that carries the field current. It makes a resistive sludge that limits the field current and therefore the alternator's output. The regulator controls the alternator's output by varying that field current, and when that grease messes things up, the alternator is severely handicapped. I have seen resistances of over 50 ohms. That cuts the field current to less than a tenth of what it needs for max output.
I have seen it many times. Kelly/Hartzell are terrible that way, and so are a lot of smaller shops. That rear bearing needs only the tiniest amount of grease, but the overhaulers tend to fill it up. What a mess.