You must stay married for at least three years to keep your citizenship. Some countries will require you to confirm that you are not just married on paper, but in every sense of the word to your partner. The reason is that many people agree to get married just to get citizenship in a particular country.
But, after registering as a citizen of a country by marriage, you cannot lose your citizenship. The exception is when you commit any offense that deprives you of citizenship.