I am not a big fan of shelfs and have my OBGYN one this Friday. To expand on the previous post, they are usually part of the third year clerkships at most schools. They require you to have a basic knowledge about the subject which may or may not be what you learn during the clerkship. Thus, it's one of those things where you just have to get review books and study out of books instead of relying on the knowledge you acquire actually doing things. Most people at my school use either the NMS series, "Secrets" series, Blueprints, and/or Appleton and Lange questions (although beware: the questions in these books are the old "fact" type, and shelf questions have all shifted to the stupid vignette type...sorry about the editorial comment there).
As I mentioned, the questions tend to all have a paragraph vignette to them and may or may not even make the questions they are asking obvious.
At least at my school, the shelf counts for anywhere from 25-50% of the overall grade in the clerkship, meaning that even if you are a great student and get wonderful evaluations, you may not get an A in the clerkship if you don't do well on the shelf. Each clerkship also has a minimal passing score (or else they make you retake the shelf or even the rotation). Check with your school to see what they do.
Yes, there are shelfs for basic science classes, but most schools don't use them since they cost the school so much. We had to take one in Micro and Path during second year. I am just looking forward to next year and being done with the things!
I hope this helped (and didn't insult your intelligence if you already knew all of that).