During the Napoleon war era in European societies, when an officer was captured, he was given the chance to swear on his honor not to escape, and then was allowed to live in relative comfort/freedom (to a point) when and why did this practice end?
Parole was, officially, still a thing in 1899 when the Hague Declarations were signed. Articles 10-12 http://avalon.law.yale.edu/19th_century/hague02.asp specifically cover parole, and it's not limited purely to officers. However, parole is limited to officers when the paroling government is a neutral detaining power. (Article 57)
The rule is still in writing in 1907. http://avalon.law.yale.edu/20th_century/hague04.asp
Note, I believe the use of "liberty on parole" means "returned to the origin country, subject to a promise to not take up arms against the power he pledged". (See Article 12) as opposed to "Living in relative comfort but still a prisoner"
The Geneva Convention of 1929 seems to delete the provisions, but Art 77 does mention, briefly, release on parole. More particularly, Article 74 mentions that any persons repatriated through a neutral country are barred from further active military service. However, it was returned in Article 21 of the 1949 Geneva Conventions. https://ihl-databases.icrc.org/applic/ihl/ihl.nsf/Article.xsp?action=openDocument&documentId=D92AB7AC378C4E61C12563CD0051AC29
The French offerred parole to German prisoners in WW1 for a while, but stopped doing so when it was noted that the Germans were not reciprocating.
There were some prisoner exchanges in WW2, but they tended to be of seriously wounded individuals, so (Douglas Bader type people excepted), the question of Parole was somewhat redundant, I can't find any mention of it. The Irish, rather famously, let all prisoners (enlisted or officer) out on a locale parole, leading to interesting incidents when Axis and Allied servicemen ran into each other down the pub. Such a document that they had to sign is here: https://worldoftanks.com/dcont/fb/image/pic_4.jpg . A limited parole was granted to Italian prisoners in the US, at least after the Italian surrender of 1943.
In the US, apparently the practice of Parole was generally stopped in the Civil War: Soldiers who decided they wanted to get out had started surrendering at the first opportunity with the intent of pledging parole and going home, and living out their lives in peace and not getting shot at, safe under the laws of conduct. Obviously this made having a war a bit difficult, so paroles stopped being offered. Mexican officers who broke their parole in the Mexican American war were hung when recaptured.
The current US policy on parole is a little unclear. Officially, the answer is simple. The Code of Conduct for the Armed Forces, item 3, specifically says " I will accept neither parole nor special favors from the enemy. " This is an executive order (10631) signed by President Eisenhower.
However, as a code of conduct, it sets standards, but arguably is not an actual regulation. In practice, there is a little wiggle room, and no Americans who accepted (local) parole were reprimanded or charged for it. The DoD sent a letter 3 July 1970 saying that they would accept "honorable release", code of conduct notwithstanding. There was a little wiggle room in the old FM 27-10 (1956, 1976), the Laws of Land Warfare, and Air Force Pamphlet 110-31, which said a prisoner " may be authorized to give his parole to the enemy that he will not attempt to escape, if such parole is authorized for the specific purpose of permitting him to perform certain acts materially contributing to the welfare of himself or of his fellow prisoners . . . when specifically authorized to do so by the senior officer or noncommissioned officer exercising command authority. " (Examples provided could include medical personnel or Chaplains travelling between camps). However, a new FM 27-10 was issued in 2016, which seems to have deleted this option. http://archive.defense.gov/pubs/law-of-war-manual-june-2015.pdf The manual basically states the official legal position on parole, mentions it as a possibility for the US to release captured personnel upon their parole, but then states that "US Policy is for US servicemen not to accept it".
However, the FM also says that though violation of the code is not criminally punishable, it may be a UCMJ violation, such as under the catch-all "Conduct unbecoming". As mentioned, past experience indicates that the US Military is not in a hurry to punish those who accept parole, and it is mentioned in FM 27-10 that on occasion the capturing force, being unable to take prisoners, may be forced to offer parole. The FM does not attempt to square that circle.
The one event which to this day rather befuddles me is of the Royal Marines captured by Argentina during the invasion of the Falklands in 1982. They were relatively promptly returned to the UK, but also turned right around and joined the Task Force back South again. Perhaps the Argentinians didn't think to ask for a parole, or they figured that the war was over, they had the islands, and there was no need to.