We study the decoherence properties of a two-level (qubit) system homogeneously coupled to an environmental many-body system at a quantum transition, considering both continuous and first-order quantum transitions. In particular, we consider a d-dimensional quantum Ising model as environment system. We study the dynamic of the qubit decoherence along the global quantum evolution starting from pure states of the qubit and the ground state of the environment system. This issue is discussed within dynamic finite-size scaling frameworks. We analyze the dynamic finite-size scaling of appropriate qubit-decoherence functions. At continuous quantum transitions, they develop power laws of the size of the environment system, with a substantial enhancement of the growth rate of the qubit decoherence with respect to the case the environment system is in normal noncritical conditions. The enhancement of the qubit decoherence growth rate appears much larger at first-order quantum transitions, leading to exponential laws when increasing the size of the environment system.