Optimal configurations for the working fluid expansion process in a piston-type cylinder with maximum work production are studied by applying finite time thermodynamics. The problem is solved by utilizing the modified Lagrangian. The initial and final volumes, initial internal energy and total time are fixed, and the heat transfer between the working fluid and the external heat bath obeys the generalized convective heat transfer law, which can be transformed into Newton’s heat transfer law, the Dulong–Petit heat transfer law and the square convective heat transfer law. The optimal configurations of the expansion process under three different conditions of heat transfer law are provided and compared, respectively. The results show that the heat transfer law has both quantitative and qualitative influences on the optimal configurations of the expansion process.