Usually the story, but it really depends on what happens to catch my eye first.
Sometimes it’s the gameplay, sometimes I just get interested in the game because it’s visually interesting or has a nice atmosphere. Oh, and I can’t say the studio plays no role in what I buy, as I usually pay a lot more attention to certain companies and thus end up buying more of their games(mostly Atlus, let’s face it).
I guess it’s mostly a combination of different factors... But I can forgive a lot of things if the story/characters are good, so I guess the story’s still the main priority for me.