there is no simple answer to that.
It depends on many things. If you're from a visa-exempt country, then yes.
If you're from a country where you require a visa to enter Canada, then you will have to apply for a visa, and convince the officer that you will be returning to your country, and show proofs of it: lease, property, university, a job to go back to etc. If your visa is granted, then you can go to Canada, get married, and be sponsored. (provided you're not married already).
If you do an inland application, it's currently 14 months. As long as you send the application before your current visa expires, then you will be allowed to stay until a decision has been made for your application. In that case, you should prepare everything in advance, fill out the forms etc, and then apply as soon as you have your marriage license.
you can also do an outland application, but it won't give you "implied status" - you will have to extend your visa. Depending on where you're from, the process might be faster with outland, or not.
Good luck,
Sweden