First of all, the type of magnet you’re using is irrelevent. Magnetism is magnetism, and whether it’s generated by an electric current, by a permanent magnet, or electrically charged angels dancing around the head of a pin matters not, it’s still the same force. Both gravity and electromagnetism are conservative forces; that is to say, an object in their field has a constant amount of potential and kinetic energy. The only way this changes to to impose an additional, outside force on the system (this being both the object in question and the mass or magnet attracting or repulsing it).
In the case of a lowering a permanent magnet to pick up a ferromagnetic object (say a steel ball bearing) from a table, the work is being done on the magnet by its attraction to the ball bearing; as the magnet gets closer, the holder has to restrain it from jumping to the magnet, until it gets close enough that the magnetic force overwhelms gravity and it jumps up to the magnet. The work done on the system comes from resisting the pull of the magnet, up until the point that you pick it up, and then it can be measured by the weight of the ball bearing and the vertical distance it moves.
In truth, with respect to the magnet, every ferromagnetic object has a given level of potential energy based upon the strength of the magnet, even though it will never come within an influential proximity of the vast majority of these objects. So, in the larger system (ball bearing, magnet, and Earth) energy still remains constant, save for whatever energy you input or remove by moving the magnet around. Picking up a ball bearing with a magnet is really no different than picking it up with your fingers, and in fact electromagnetic attraction and repulsion is involved in both actions (see the previous thread: [post=5771403]Why can’t my hand go through my desk?[/post]).
Now, some smart-alec is going to come along and ask why electromagnets take so much damned energy to generate a field while permanent magnets seem to take nothing at all. The answer to that is that electromagnets generate a field by moving electrons around in a big loop, and in most common materials at normal temperatures this causes a great deal of loss. You can hear this in the disturbing humming of big electromagnets in a crane. However, a superconducting loop would (in theory) have no losses at all, and so all you’d have to do is charge it up and seal it off from ground. The reason permament magnets work is conceptually more complicated and requires quantum theory to explain, but essentially it’s a result of the combination of electron spin and (atomic) orbital angular momentum resulting in a dipole moment. So instead of going around in a loop it’s just spinning frenetically about itself. (The last statement is, strictly speaking, totally wrong, 'cause that’s not the way things work on the quantum level, but it’ll do as an analogy until you crack open Volume III of Feynman’s Lectures.)
I hope that makes things clearer than a Teamster’s pension plan audit. Now, if only this kind of stuff impressed the chicks…
Stranger