The right to bear arms that is detailed in the Second Amendment of the U.S. Constitution carries a lot of red tape. Only in a few places can a person simply wear a concealed gun without any sort of permit or documentation (parts of Alaska have this rule). Police officers are expected to carry guns at all times, but military personnel (who you might also expect to carry weapons) have a number of additional rules to follow when they aren't on duty.
The age at which an active-duty military member can buy and own a gun is no different because of their military standing. For instance, a person may buy a "long gun," such as a rifle or a shotgun, at the age of 18. But in some places, such as Indiana, the law states that a person must be 21 years old to buy a handgun. Just because a person is on active military duty doesn't give him special gun purchasing or ownership powers. While a 19-year-old Army soldier may be fully trained with the weapon, he still can't purchase a pistol to own until he's of age.
Generally speaking, military personnel are not allowed to carry firearms on a military base that haven't been issued to them, or which are not the specific standard issue type of firearm. However there is some confusion in the legality of officers carrying non-standard issue pistols, because there is wording in military law that states officers have the right to be armed at all times. As a result, officers sometimes break the general rule of not being armed on a military installation because it is their right to be armed due to their rank.
Military personnel, even active-duty members, must abide by state laws when they are not serving in a military capacity. For instance, a soldier may carry a pistol when she is serving on American soil. However, when that soldier is off-duty, she must have a concealed carry permit in order to continue to wear her firearm. Although some states recognize an out-of-state permit (for instance, an Indiana permit is considered valid in Wisconsin and Michigan), other states do not (Illinois will not accept an Indiana permit). A soldier should be sure she has the proper documentation just like any other citizen when she is not acting in an official capacity.