We examine the performance of a finite-time, endoreversible Otto heat engine with a working medium of monolayer or multilayered graphene subjected to an external magnetic field. As the energy spectrum of multilayer graphene under an external magnetic field depends strongly on the number of layers, so too does its thermodynamic behavior. We show that this leads to a simple relationship between the engine efficiency and the number of layers of graphene in the working medium. Furthermore, we find that the efficiency at maximum power for bilayer and trilayer working mediums can exceed that of a classical endoreversible Otto cycle. Conversely, a working medium of monolayer graphene displays identical efficiency at maximum power to a classical working medium. These results demonstrate that layered graphene can be a useful material for the construction of efficient thermal machines for diverse quantum device applications.