Quite a few people in my program have gotten F31 grants. You have to write a comprehensive research proposal, and submit it to NIH (or a division of NIH like NIDA or NIAAA). It's very extensive and very competitive, and it make take a couple submissions before getting accepted (or may not get accepted at all). It runs on a scored system and the # or threshold of score for funded proposals depends on the year/funds available.
An F31 is a great deal and looks awesome on your CV. You get year-round funding, usually more $ than an RA/TA, and money for things like running subjects, travel for conferences, and other incidentals.
Though I agree with Ollie123, the type/reputation of the program you're in does play a factor. So does your undergrad institution, GRE, past GPA, etc. Basically they look at the big picture of your academic productivity in an attempt to predict whether you'll be a good investment in regard to future research generator.