Momentum and energy are always conserved. The question is not whether they are conserved, but rather whether there is a way for them to be transferred to the environment where you lose track of them. To answer these questions actually involves looking beyond the pictures shown.
What happens to the pole after the edge of the picture? Is this a pole anchored into the ground? If so, it is capable of transmitting linear and angular momentum from the system in the picture into the ground. This doesn't mean that it is doing so. We'll touch on that next. But at least we know that its possible. Were this a pole free-floating in orbit, it would have no way to transmit momentum (linear or angular) out of the system. Can it transmit energy? The question there is whether it can do work. Since the end of the pole can't move (it's stuck in the ground), the distance it can travel is 0. Thus it can't transmit energy, no matter how much force it exerts. Any force times 0 distance is 0 work.
But what about the string? In the first picture, you must intuit that the string is attached to something. Why? Because the problem says the string is gradually shortened. That's an operation that can only be done by something pulling on the string. And when we pull on the string with a force over a distance, we put energy into the system. Thus we can say that energy may not be conserved in the first picture (we'll discuss whether it actually is in the next part). The string down the center cannot provide angular momentum (we usually assume strings can't do this, although sometimes a "cable" can), but it can transfer linear momentum in the up and down direction. It can't transfer linear momentum in the horizontal directions. Contrast this with the string in the second picture. It is not being pulled in the direction it is moving. It does move towards the center as it wraps around the pole, but that's at right angles to the tension force in the string, so it does no work.
Now we've captured the different ways that energy or momentum could be transmitted out of the system. We determined that by looking just outside the picture. The next step is to figure out whether any of these mechanisms are indeed transmitting energy/momentum. This involves looking at the system again, in the context of these external effects.
Consider the first case. There were two external influences: the pole and the string. The pole could transmit linear momentum, in all three directions. And when we look at the free body diagrams we find that it does indeed transmit linear momentum in the two horizontal axes. If it did not, the change in momentum of the mass in the left/right axis would need to correspond with an equal and opposite change in momentum of something else in the left/right axis. It's clear something is transmitting linear momentum in the left/right and forward/back axes, and that's the pole. Linear momentum is not conserved in those two directions. Linear momentum is conserved in the up/down axis. That's not because the pole couldn't transmit momentum in that direction, but simply because the setup never did so. If the mass was orbiting at an angle, higher on one side than the other, then it would indeed transmit momentum in the up/down axis.
(fun fact, for circular motion like this there will always be one axis that isn't transmitting momentum. It might not be the obvious up/down/left/right/forward/back axes. It might be at a funny angle, but there's always one. Sometimes we take advantage of that in our mechanical devices).
What about angular momentum? If we considered the friction along the top surface of the pole, we might say that it's transmitting angular momentum. There would be an angular velocity and a torque due to friction. However, if we consider the top of the pole frictionless, the pole in fact does not transmit angular momentum. Were we to weld a bar between the mass and the pole
instead of a string, then it would likely be able to transmit angular momentum.
Now what about the string. It can transmit energy, and it can transmit linear momentum in the up/down direction. Does it transmit energy? It does. You put a tension force on the string and pull it for a distance, so work is done. Thus energy is not conserved in case A. Does it transmit momentum? It could, but if we look at the setup, there's no change in momentum in the up/down direction. (of course, we already confirmed that the pole transmitted linear momentum).
So in case A, we have no conservation of linear momentum (due to the pole) or energy (due to the string). Both environmental interactions transmitted no angular momentum, so angular momentum is conserved.
In case B, we have roughly the same situation. Its exactly the same situation for the pole. However, the string is a little different. In this case, it can't transmit energy out of the system because it's entirely in the system.
So this means in case B, we have no conservation of linear momentum (due to the pole), but we do conserve energy and angular momentum.
This process is not always obvious. The hardest part is that it involves thinking outside of the picture presented, looking at how it interacts with the environment around it. The questions do not always do a good job of making this clear. (one notable exception: Statics classes are extremely clear about what forces and torques are possible with the environment). However, by thinking a bit about the environment outside of the system, we can determine potential ways to transfer conserved values out to the environment. Then we can look at the system itself to see if it is indeed transferring any.