You still have rights while you are in jail, one of them is to marry. From what I've seen (on that show Prison Wives) that the wedding takes place during regular visiting hours and a preacher and/or Justice of the Peace marries them. I would assume the one that isn't in jail would need to get all the paperwork and file for a marriage license.
It's Prisons where inmates can get married. If you're in a county jail, chances are you're serving less than 12 months & you're just going to have to wait to get married. Prisons do things differently bc inmates are serving longer sentences there.