Toenails can separate and lift off the skin for many reasons, you should consult your doctor immediately. The most likely cause is a fungus, which is usually easily treated.
Stubbing your toe causes damage under your toenail and it bilisters, raising your toenail. The bister heals over time the skin retuns to normal, but the nail will remain raised.
Fungus is a common cause for toe nails separating from the nail bed. Topical treatments do not treat the root. Affective treatment can be prescribed by an MD.