Deleon Alonso Smith in southwest Houston died of the gunshot wound to the throat after accidentally pulling the trigger.
Family members said that Smith has two young children and was about to start college.
Investigators said Smith's cousin was in the apartment but in another room when the incident happened yesterday.
The cousin told police they found the gun earlier in the day but it is not known how they came to possess the weapon.
"It's a numb feeling. It's still unbelievable," Smith's grandmother Alma Douglas told local radio station 'KPRC'.
In a similar incident earlier this year, a 21-year-old woman in Russia had shot herself in the head while taking selfies with a gun. She was critically wounded, but survived the incident.