Games where you take turns attacking until someone loses all their HP are called RPGs, or more specifically, turn-based games.
In these titles, players and enemies alternate moves, strategizing each turn until one side runs out of health. It's a classic mechanic found in countless role-playing games.