Temporary hit points are a buffer against damage, not actual hit points.
When you take damage, temporary hit points are lost first. Any leftover damage carries over to normal hit points.
Healing cannot restore temporary hit points.
Temporary hit points do not stack. If you gain them while you already have some, choose which amount to keep.
Unless a feature says otherwise, temporary hit points last until depleted or until you finish a long rest.