Permanent magnets are made of magnetically hard materials such as steel. These materials retain their magnetism once magnetised.
Some materials like iron are magnetically soft. They lose their magnetism once they are no longer exposed to a magnetic field. They are used as temporary magnets such as electromagnets.