Can you have a conviction for a gross misdemeanor and still keep your private pilot's license?
The most important thing to say here is that the only way to get an answer for a specific case is to consult an aviation attorney. Don't rely on any answers you get here!
Having said that, the general answer (that may not apply in every case) is that the FAA is primarily interested in alcohol and drug actions and convictions, including driving offenses and drug transportation. Pilots have to report those per 14 CFR 61.15, and again in any future application for a medical certificate:
Do I have to report anything other than alcohol and/or drug related convictions?
Yes, under 14 CFR Part 61, you must report alcohol and/or drug related administrative actions, whether a conviction took place or not. Arrests, administrative actions and convictions are also reportable under Part 67, the airman application for a medical certificate.
AOPA has a good explanation of the reporting requirements and their Pilot Protection Service can help with medical and legal issues. But it isn't a foregone conclusion that you lose your certificate, at least in 'simple' DWI cases:
A single driving while intoxicated (DWI) arrest, conviction and/or administrative action usually is not cause for denial provided there are no other instances or indications of substance dependence or abuse.
Leaving aside alcohol and drugs, if the misdemeanor had nothing to do with aviation then it's unlikely to come within the FAA's scope. There might still be some odd theoretical possibilities, like if the misdemeanor conviction attracts the TSA's attention and you're flagged as a security risk (see 14 CFR 61.18) but that's just playing with 'what if' scenarios. Again, you need to consult an aviation attorney for advice on specific cases.