I am not that experienced, but you were on the losing end of this game long before you captured with your king at the last minute.
Last-Minute Losses

Yes, pavanshahm is right. Remember, black always starts >=1/2 turn behind, and the Caro-Kahn only reinforces that lack of momentum by black. I would say that you were losing by 4. .. Nfd7. By move 2, White has asserted control of the center, while your entire right half is congested (you don't move a piece from the right backline until 11. .. Nf3 - think about that). With 4. e5, White creates a defilade to your kingside, which you castle to, but already you should have been considering a Qside castle with the impending 11+ points White is about to place in the six squares in front of such a castle, especially with both of your knights to your Qside. Further, why castle into a ma01 threat? Your whiteline bishop does nothing until the very end. At 8., I would have exchanged with Bxg5, which you don't because you thought it would be messy but in fact you end up doing so anyway at move 15, preparing for 9. .. Qe1, so that when you advance f6, you reveal a threat onto White's unprotected Q (an exchange you would want at this point). With 13. Bxh6 .. 14. Qxh6, White has eviscerated the unprotected pawns in front of the king, and you should really be thinking, "I am naked and alone on a white square with all my power stuck to my right and on black lines. I'm done." Ergo, I would have resigned at 14. Your comment at 16 is incorrect, and illustrates the point that your thinking in this game is rather skewed - here, yes, you are up a piece, but a real base score on just material is: add a point for each of White's advanced pawns (two points for 6th rank, three for 7th rank), and subtract at least one point (I'd say two) each for your useless knights at that point, which are neither defending or attacking anything (of importance). So, totally disregarding the Q staring at your naked king, by material you are actually down a piece. The burlesque counts as at least four, so you're really down a Q. My advice: you are clearly adhering to the very good rule that, at each turn, ask, "What is my opponent doing?" However, also consider that rule's flipside at each turn: "What am I doing?" The sum of my analysis is: right from the opening, you lost momentum, never gained it, blocked your right half, castled into an unprotected left half (prematurely and telegraphed), and never broke the defilade White built along the center with e5. My best alternate to offer: 4. .. Ne4.
Note as well that for 7. .. 16. hxg5, nothing is protecting White's Q: she's hanging out there in front of your king with impunity, directing traffic directly at your three little pawns. My best advice: build a better narrative. Reassess how you prioritize. Each game tells a story.

@lapsekili: You were losing for quite a while in the game. For instance, 17. Qh7+ Ke8 18. Qg6+ Kd7 (18...Rf7 19. Rh8+) 19. Rh7+ is winning for white. White is positionally totally winning after 20 moves too.
Probably 13. Bxh6 was sound (as far as I can tell.) So the problems came from before that. Going backwards, 10...f6 is very weakening. 9...Nb6 could be replaced by 9...c5 striking back in the centre, going after the vulnerable d4/e5 pawns. 7...0-0 castles into trouble; 7...h6/c5 can be considered, although white's Nxf7 sac can become dangerous. And 3...Nf6 cramping you horribly is inferior to the mainline 3...dxe4.
I swear I already pointed out the lethal tempo saving 14. Qg6+ Kh8 15. Qxh6+ Kg8 16. Qg6+ Kh8 17. Ng5 when Black has no satisfactory way to meet Qh7#.
15. Qg6+ amounts to the same thing.
Did you actually post this game twice?
http://www.chess.com/forum/view/game-analysis/loss-against-stronger-opponent
You did. Phew for a few minutes there I thought you actually play this more then once.
I was defending well since the blunder at the end of the game,i.e moving the Queen to somewhere which looked natural to me.It is sad for me to lose like this and last-minute losses happen to me often.How can I avoid such blunders?I need help of more experienced players.