If a man marries a woman, he is exempt from military service for one year. Not only is he excused from battle, he is not even to be given administrative duties. We see this from the fact that the Torah says “he shall not go out with the army” (meaning battle) “nor shall he be given any other task” (meaning such things as paperwork or KP duty–see Talmud Sotah 44a). This is unlike others who are excused from battle, such as cowards (Mitzvah #525); they were given other duties to perform, off the battlefield.
The reason for this mitzvah is to support the institution of marriage. We want the new couple to get off on the right foot and yanking the husband out of the house so soon in the relationship doesn't help matters any. This is unlike the case of one who betrothed a woman but did not yet marry her or one who built a house but didn’t live in it yet. In those cases, the soldier is excused from battle because we're afraid he might get killed and someone else will marry the woman or move into the house. In the case of the newlywed, we want to enable him to spend time with his wife, so he’s exempt even from non-hazardous duties.
This mitzvah applies in Temple times, when we go out to war. It is discussed in the Talmud in tractate Sotah on page 43a and codified in the Mishneh Torah in the seventh chapter of Hilchos Melachim. This mitzvah is #311 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.