My school has a required longitudinal research project, so it's certainly possible to fit research in. How much you want to put in is an individual choice. Some people have a hand in multiple projects, many people take a year off for research, some just do a smaller project. Some do clinical, some do bench, some do translational, some do medical education research.
Like it has been said, most people do research the summer after MS1. Many people work in a lab or contribute to a project during MS2, but that's not required or super common from what I've noticed. Super eager people start working in a lab during MS1, since you have to shop around for labs anyway for the summer. And then most (almost all?) of us here will take at least one research month elective during MS3/MS4.
As for competitive residencies, it depends. We recently had a talk from a neurosurgeon who said that they don't consider anyone without at least one pub in neurosurg. Not sure what the deal is for other specialties or other programs, but if you want a competitive specialty, especially at a top program in the field, you should probably aim for at least one publication in that field.