I got married while on a student visa.... I know things change SO FAST for visas lately, but my experience was:
- We gave notice of intent to marry at our local council office (i.e. didn't go to a special office for that.) You don't need to involve the home office in your actual marriage. You do have to give notice in person though, as you'll need to provide proof of address, your passports, etc. and there will be a brief interview for both of you, separately. At least that's how it was for us. I believe you have to give notice at least 2 weeks before you get married - then you have to go back to the office a couple of weeks or so later, pick up your permission to marry, and get that to the registry office that is actually marrying you (in other words, if you marry outside of your local council area, it's up to you to get the permission info. to the council where you're actually marrying. If you're marrying locally, you don't.)
- We got married at the end of September, 2004 - my student visa would have run out a month later - there was no rule that I was aware of that I needed my new visa three months before my old one ran out. To the best of my knowledge, once you submit your application for a new visa, you're legal to be here even if your old one runs out.
- I applied for FLR (M) about a week after our ceremony and did it in person so got it that day. Since I already had a visa, it wasn't necessary to get a new entry clearance - it was just further leave to remain
- After another year I'll apply for ILR
I would think that if your visa runs out while you're out of the country, you will have to apply for a new one before coming back. So if you get married abroad, just make sure you do so before your student visa runs out....
Again, this was just what I experienced. Hope it's helpful....