In general, the Geneva Convention does not specify the terms of repatriation during wartime for PoWs whose health is not at risk. The cases it does cover are: the sick and wounded during wartime, and the repatriation after the war ends.
Article 109 specifies that the detaining side should repatriate seriously wounded and seriously sick prisoners of war as soon as possible without causing additional risk ("after having cared for them until they are fit to travel"). But his article also states:
No sick or injured prisoner of war who is eligible for repatriation under the first paragraph of this Article, may be repatriated against his will during hostilities.
On another hand, Article 118 is equally clear:
Prisoners of war shall be released and repatriated without delay after the cessation of active hostilities.
This article lacks the provision for the willingness article 109 has.
That said, traditionally, many governments apply the same logic to the article 118 that is present in the last sentence of article 109. Notable cases where this principle had been applied include the Korean War, where significant numbers of Chinese and Korean PoWs expressed desire to stay in detaining countries after release, and the Gulf War. In the latter case, the detaining side (Saudi Arabia) granted refugee status to ~13000 PoWs unwilling to return to Iraq (source: ICRC 1991 Annual report, page 102).
In any case, the position of ICRC is that
...prisoner’s refusal to be repatriated cannot be based on mere convenience. Rather, there must be ‘serious reasons for fearing that a prisoner of war who is himself opposed to being repatriated may, after his repatriation, be the subject of unjust measures affecting his life or liberty, especially on grounds of race, social class, religion or political views, and that consequently repatriation would be contrary to the general principles of international law for the protection of the human being’.
and that any refusal should be evaluated on case-by-case basis.
This means that one cannot refuse to be repatriated to escape punishment for desertion, unless the reviewing entity decides that such punishment would be "unjust".
P.S. Note that most countries include some sort of impressive punishment in their legal system for failure to fight the enemy to the best of soldier's ability. For example, in USA, Article 99 of the Uniform Code of Military Justice states that one might earn himself a life in prison for willfully surrendering to the enemy (although, as far as I understand, usually less severe punishments are used).