They're both solid games which do certain things better than others.
Shift 2
+ Better visuals. It's just so much more crisp in terms of graphics, and the shadows/jaggies in GT5 can be brutal. And to me it seems like Photo Mode of GT5 really makes the game look better than it is in motion, where as in Shift 2 it just generally looks good all around. And this is even without any user mods yet. And of course I'm only referring to the PC version, I have not seen the console version of Shift 2.
+ Better sense of speed. A fast car feels very, very fast in Shift, where as in GT5 they're fast, but I just don't get the same feeling
+ UI/Menu navigation. It may look a little prettier in GT5, but it's so much easier in Shift 2. Not to mention the minimal load times where as on the PS3 it can get frustrating sometimes
+ "Overall" car customization. I would think GT5 would win this easily, but in Shift 2 I love the liveries, I love being able to really paint the car however you want, and the rim selection is great.
GT5:
+ Car selection. I guess that one is a bit obvious, seeing as it has 1000+ cars. However of course a lot of them are the junk/pointless "standard" versions, I still can't believe they did that. However the premium cars are great, and they have Ferrari's. And I guess if you like Nascar, they have that too.
+ Weather system. The night racing in Shift 2 is great, but in GT5 it's also great and you have rain/snow added to the mix. They did a great job on this, of course it would be nice if it was on more tracks but whatever.
+ Photo Mode. Photo Mode in GT5 is......amazing. You could almost make a game out of that yourself. They really did a great job on this.
+ "Overall" car handling/physics. I love how it feels to play Shift 2, but GT5 really just does an amazing job of making so many different cars feel unique.
I didn't think I could see myself in a situation where I played 2 games for a long amount of time that were similar in this way, but I think in these 2 I've found that scenario. Shift 2 has great things about it that GT5 doesn't have, and vice versa. I have a great time with both games, and yet while playing one I find things to wish that the other had. I guess that's what competition is all about.