First create a sprite containing the image you will use to display the health and make sure you have a my_health variable in the main character's Create event set to the number of lives you want the player to start with.
On your player character add a Draw GUI event and add the code on the left.
This code creates a temporary variable called _sprite_distance and sets it to ten.
Then, for every life the character has the heart is drawn and the _sprite_distance variable is increased by the width of the sprite to decide the location of the next heart.