The term you are referring to is called "agonal" breathing.
Some often refer to such breathing as the "death rattle." The "death rattle" is a wet rattling sound that is often heard due to the weak breathing before dying. It is heard because of the dying person's inability to "cough-up" or "clear" the secretions in their airway.
"Agonal" breathing is a type of gasping for air. The mouth is usually partially, if not wide open. Such breathing usually indicates imminent death.