The Lamp is brought to life by the Ancient Sleeping Magi of Life Giving in the episode "Friends Forever." Ice King tries to trick the Magus into touching it with his bare hands, but when the Magus does not fall for it, Ice King kicks him over on top of it, causing him to unwillingly touch them and bring it to life.
Like most of Ice King's living furniture, the Lamp appears to be highly intelligent and speaks with a very sophisticated vocabulary which the Ice King finds confusing. However, unlike their fellow furniture, they possess a decent amount of pity for the Ice King and attempts to find ways for him to fit in.
We cannot classify the Lamp into binary gender or sex categories: in response to Ice King referring to the Lamp as "a lady," they reply:
“Well one isn’t purely defined by their sex or gender. I have yet to find out who I really am. I have freedom, no longer bound by the limits of my cord. Freedom to shape my reality, and in turn be shaped by it.”