Welcome to the forum.
A bad fuel filter or bad fuel line would be my first guesses. I'm thinking the latter.
If there's a fuel filter between the tank and the carb, it could be letting "some" fuel go through (enough for idle) but not enough when you give it the gas.
If your fuel line is old and is dry-rotted where there's a crack or hole in it, when it goes to pull more fuel, that crack (hole) is allowing air to be pulled instead (drawing from the path of least resistance). You're not getting more fuel, just air.
Those are 2 easy things to inspect/fix/replace. For the fuel line, if you see some places that "don't look right", try wrapping some electric tape around as an intermediate measure to do testing to see if you can get higher RPM's. Be advised though, if the fuel line is bad enough where it could leak out onto the tape, it'll eat the gummy part of the tape over a period of time and make it worst. It's a quick fix for testing but if it fixes the issue, replace the line and don't rely on that tape.