Luffy got his scar during the Marineford arc when his brother ace died.
Jimbei was carrying him and was trying to escape from Akainu. He jumps into the sea but found the water frozen.
Akainu manages to strike the Jimbei and it also lands the damage to Luffy
Later on Jimbei makes an apology to Luffy for letting him injured
This incident has occurred in Volume 59 Chapter 578 and Episode 487
In the image above you can see Luffy Chest is burning when Akainu punch gets past the Jimbei body.
Even in the Wikia, it has been mentioned.
After the Timeskip
After two years, Luffy wears an open long sleeved red cardigan with four buttons showing X shaped scar on his chest received by Admiral Akainu.
If you have not gone through this manga yet, here is little description about One Piece
One Piece is a Japanese manga which has been penned down by Eiichiro Oda. The manga is the part of Shueisha’s Weekly Magazine. One Piece follows the story of Moneky D. Luffy, a boy who gained rubber human properties after eating the devil fruit. His crew of pirates is called as Straw Hat, where Luffy embarks his journey across the sea in the search of world’s ultimate treasure called One Piece