Does the UCMJ apply after you leave the military?

Apparently that’s not always the case. This JAG report discusses some cases involving discharged prisoners:

http://www.armfor.uscourts.gov/annual/FY00/FY00ArmyReport.pdf