The shape of the magnet can have a small effect on its strength but the real strength of the magnet comes from the mass, density and material. A more magnetic material will make a stronger magnet. Changing the shape will only let you focus a little more of that strength into a different direction or area.
A great example is a magnet in the shape of a donut. If you put something in the center of the donut, the magnetic field cancels out because the forces from all the different directions are equal, so there is no pull force. It would be as if the magnet wasn’t there. But outside the donut, it behaves like a typical magnet.
In basic terms you can’t get more magnet strength out of an object by reshaping it. A magnet has a strength based on its size and materials used, but the shape has an influence how its best used.
What you can affect thru the shape is the strength of the magnetic field. For example, if your goal is to keep 2 cabinets closed, using a flat disk magnet makes more sense than using a long cylinder. It’s not that the disk has more power, it’s that the cylinder doesn’t focus the magnetic field in a way that’s useful for that particular application.