Obviously, any crime can affect your ability to maintain status when you're a guest in another country. I don't know the details of your plea and record, and I'm going to assume that the USCIS will treat you as having a conviction of possession. For purposes of immigration, the USCIS takes drug crime very seriously. Possession of < 30 grams of marijuana can trigger ineligibility but, if it does, you should be eligible to petition for a waiver.