Will an operation to correct a deviated septum stop me from snoring?

Maybe. Deviated septum surgery is done primarily to improve breathing through the nose. Some people find their snoring is better afterwards but that is very unpredictable and is not a main reason to have that type of surgery.
It is possible. It is possible to decrease snoring but improving the the airflow through the nostrils. Before I perform nasal surgery, I will have patients use topical decongestants (nasal steroids) to see if there is any change in snoring and nasal congestion. Depending on the results, then nasal surgery (septoplasty) can be helpful in treating snoring.
Possibly. If you mouth breath while sleeping correcting nasal obstruction can promote better airflow and hopefully lead to less turbulence and less snoring. Rarely though dose a septal operation by itself improve nasal breathing fully. I, almost always, also reduce the size of the inferior turbinates (structures that make mucous). My preferred method is using a "shaver" like liposuction.