as an IM resident
1. internal moonlighting
Generally midlevel/resident shifts at your own institution. Do not usually need a full state medical license. Often reimbursed at midlevel hourly rate or slightly below.
2. external moonlighting
Will require a full state medical license, which depending on your grad status (USMD vs IMG) and state, requires 1-3 years of residency to qualify for. Also usually requires a individual DEA license (not the one you get through your residency institution), state controlled substance license, etc. These jobs can be difficult to find during residency since most employers want you to be board eligible/certified, which you won't be until completing 3 years of IM residency. Depending on location may be able to find urgent care work. There are gigs doing physicals for medicare patients that often pay ok.
as an IM fellow
1. internal/external moonlighting
Get your full state medical license, DEA license, etc. Most locations will have options to pick up hospitalist work (admissions, day wards, etc), reimbursed at geographic rates for IM (usually somewhere between $150-200/hr). Most employers will supply malpractice insurance. Generally looking at nights or weekend days, as most GME offices don't allow picking up shifts during weekdays since that is the time they're paying you for.