Immortality (or eternal life) is the concept of living in a physical form for an infinite or inconceivably vast length of time. Immortality is one of the known limits to magic; it is nearly impossible to make oneself immortal the only known and working ways are making and using a mystical object of great power to sustain life (such as the Philosopher's Stone created by Nicolas Flamel or a Horcrux, the latter having been used by Lord Voldemort). If one were to possess the three Deathly Hallows, it is fabled that they would possess the tools to become the "Master of Death". However, being a true "Master of Death" is to be willing to accept that death is inevitable.
The Philosopher's Stone, a Stone created by famous alchemist Nicolas Flamel, is able to produce the Elixir of Life, one of the known means of immortality. In 1991 and 1992, a weakened Lord Voldemort tried to gain possession of the Stone so he could rise again after his downfall ten years prior. The Stone was then destroyed by Albus Dumbledore and Nicolas Flamel himself in order to prevent this from happening again. With the destruction of the Philosopher's Stone, all individuals who were immortal because they drank the Elixir of Life (like Flamel and his wife) died after the supply of Elixir ran out.
The Elixir does not truly grant immortality, as it only extends the drinker's lifespan, as opposed to rendering them invulnerable to damage. Thus, it is possible for them to die even while drinking the potion.
A Horcrux is an object chosen for the purpose of being a receptacle of one's part of his soul, split by doing the most inhumane action: murder. If all the Horcruxes (and by extension the wizard's soul) are intact, the wizard is considered immortal.
Lord Voldemort split his soul six times in order to maintain his status of immortal being, and kept his Horcurxes a secret from absolutely everyone to protect his own life. He had split his soul that many times in the likely belief that seven is a powerful and magical number, but had intended to make only six horcruxes, with the seventh part of his soul remaining inside himself, thus a seven part soul. Unbeknownst to him, his soul was split a seventh time. The seven Horcruxes were all items owned by reputable people that played an important — or scarring — role in his life, including the Four Founders. His best plans were, however, beaten due to his arrogance, when Regulus Black, Albus Dumbledore, Harry Potter, Ron Weasley and Hermione Granger discovered his secret and found each one of his Horcruxes and destroyed them, returning Voldemort his mortality and led to his eventual and final death.
Whenever phoenixes die, whether from old age or something like a Killing Curse, they always reborn from their remaining ashes, technically making them immortal. They are so far the only living beings who possess natural immortality. They are also the only creatures who defy the absolute law that nothing can truly bring back the dead.
Fawkes, the pet phoenix of Albus Dumbledore, has been reborn from old age many times, and revived instantly from his remaining ashes when swallowing Lord Voldemort's Killing Curse and exploding.
Unicorn blood has the gift to save a drinker from death even when they are nearing it. This makes it similar to the Elixir of Life, which also extends the life of the drinker. However, if taken, it will lead the drinkers to be cursed for all life, as they had slayed an innocent creature.
Quirinus Quirrell drank unicorn's blood while he was possessed by Voldemort, in order to maintain both of their critically near-end lives, until they can gain access to the Elixir of Life. Later, Voldemort had Peter Pettigrew to craft a Dark potion that requires unicorn blood as one of the ingredients to maintain his rudimentary physical form, which would require him continuous intake of the potion.
Many wizards believe that the person who masters the three Deathly Hallows (which are the Elder Wand, the Resurrection Stone and the Cloak of Invisibility) will be the Master of Death and will be immortal, while a larger proportion dismiss it as a fairy-tale. Being Master of Death is realising and accepting the fact that everyone will die and there are worse things than death. Harry Potter collected the three Hallows and was willing to accept death and so became the Master of Death.