For me and Steve, I don't think it was a struggle really. We've been 'together' roughly 3 years or so, but knew each other for longer than that, and he had been married once before me--it could of gone to one extreme where he wouldn't have wanted to get married because of having such a sour experience with the first one, etc. But, obviously it didn't, thankfully
It took us a couple years, and a few visits to realize that to be together, marriage would be the only viable option, but thankfully for us it seemed as if our relationship was naturally progressing to that stage anyway. Steve started to mention it from time to time right before I visited the UK for the first time, since I didn't want to make any major decisions until I had been over there--I was pretty sure I'd be fine with the UK, but I wanted to make sure (well, as much as I could while only being able to visit). And I knew I had pretty good chances of making a life in the UK once I visited, and it clicked kinda. And Steve needed the time between my first and second visit to decide that he was ready to make the commitment, not only to get married but to help me come over to be with him.
So, he proposed during my second visit--he had hinted at it a few times the first couple weeks I was there, but he waited until around Thanksgiving to actually get the ring and propose. I'm an extremely lucky girl in the sense that all of these factors came together just right--it was something we wanted to do, it was the right time in our relationship for it, and it was the only real viable way for us to be together.
When me and Steve first got together, we figured that marriage was just a piece of paper, and I figured 'eh, I could live with us just living together if we could' but now that we are married, I don't believe that really. I don't think I would of been content to just live together forever--for some people that's awesome, but I don't think it would of worked for me in the end. Thankfully enough Steve wasn't scared of getting married again either, and he wants to have a healthy, long marriage unlike the last time--he wants another shot at making things right, and loves me to bits and wants to make it work with me.
As for how and when to handle the subject? I guess it depends on each individual couple, since some people come to the realization sooner than others. It just takes a lot of introspection on the part of the couple, and I think it has to be something you'd want to do *irregardless* of any sort of immigration process, since when everything is said and done, getting the visa is temporary. You still have to live with the person afterward, and all the issues that come with 'normal' marriages ('normal' in the sense of marriages without immigration issues tied into it) will crop up, and the couple has to be ready to deal with all of that.