The spouse of a permanent resident is in the F2A category, which currently has a wait of 1-2 years for visa numbers. That means, after the permanent resident petitions the spouse, there is a 1-2 year period before the spouse can go to the next step. If at that time, the spouse is still in the U.S. and in valid status, then yes, they can do Adjustment of Status in the U.S. Otherwise they will have to go tack to their country and do Consular Processing.