Each of the services have an assignment program called "JOIN SPOUSE." Basically, under this program, the military will try as hard as they can to station military spouses at the same base or within 100 miles of each other. Note there is no guarantee -- the military just agrees to try. The services will not create a new slot for JOIN SPOUSE. There has to be an existing slot in the rank/job that the member(s) can be assigned against.
DOD-wide, about 80 percent of military-married-to-military couples are assigned within 100 miles of each other. That sounds pretty good, until you realize that means 20 percent of military couples are not assigned close to each other. I knew one military couple who did an entire 20-year career in the military, without once being assigned together (special case -- she was a Naval Officer, and he was an Air Force test pilot).
One of the primary factors to consider when contemplating a military-couple marriage is if both members are in the same service. Obviously, it's easier for the services to assign couples together when both are in the same branch. For one thing, it takes less coordination, as only one branch assignment division is involved. Also, remember that I said the services will not create a job-slot just to assign couples together? Well, there just ain't that many Air Force airmen assigned to Marine Corps bases, nor many Marines assigned to Air Force Bases. Additionally, there aren't that many Air Force bases and Marine Corps bases that are close together. So, marrying someone in your same branch of service obviously increases your chance of a successful JOIN SPOUSE assignment.
In order to JOIN SPOUSE to work, both members must apply. If only one member applies for a JOIN SPOUSE, the assignment system won't process it. Then it's up to the military to determine who should move (or whether both couples should move), based on the needs of the service and funding constraints.
One thing I should mention that trips a lot of folks up when it comes to JOIN SPOUSE -- normal time-on-station rules apply. For example, in general, in order for a first-termer (a military member on his/her first enlistment), assigned to a CONUS (Continental United States) base, to move overseas, he/she must have 12 months time-on-station. In order for the first termer to move from one CONUS base to another, he/she must 24 months time-on-station.
For "careerists," (those who have re-enlisted at least once), the time-on-station requirements are greater. For a careerist to move from CONUS to overseas requires 24 months time-on-station, and to move from CONUS to CONUS requires 36 months time-on-station.
When one is assigned to an overseas tour, there is a set-tour length, generally (for most tours) 24 months for a single person, and 36 months for a married person who is accompanied by his/her spouse and/or dependents.
So, let's say that Private Jones and Private Smith meet and fall in love at AIT (job training). When they finish AIT, Private Jones gets assigned to Washington D.C., and Private Smith gets assigned to California. After a month, they decide they can't stand to be apart, so they arrange to go on leave and get married. Guess what? Neither one can move to the other's CONUS base for two whole years! Of course, they could both put in for overseas and apply for JOIN SPOUSE, and hope they get picked up for an overseas assignment, and can then both move after 12 months time-on-station.
Another scenario: Jack and Jill are engaged and join the Air Force at the same time. They agree to wait until they make it through basic training and Technical School (job training) to get married. While in technical school, Jack gets a two-year assignment to Japan, and Jill gets an assignment to Florida. If they wait until after they leave technical school (on leave and on their way to their respective assignments), it's going to be too late for JOINT SPOUSE. JOIN SPOUSE can take several weeks to process, and by that time, they will both be at their new assignments. Then, time-on-station applies. Jack is ineligible to move until his rotation date two-years down the road, and Jill isn't eligible to move overseas until she's been at her CONUS assignment for 12 months.