You can't turn off a 'permanent' magnet ... a piece of iron that's magnetized.
An electromagnet can be turned on and off. It's only magnetic when electric current flows through the wire that's wrapped around it. The wire is connected to a battery or other power supply. So if there's a switch in the wire, the electromagnet can be switched on and off.