Stellar flares are abundant in space photometric light curves. As they are now available in large enough numbers, the statistical study of their overall temporal morphology is timely. We use light curves from the Transiting Exoplanet Survey Satellite (TESS) to study the shapes of stellar flares beyond a simple parameterization by duration and amplitude, and reveal possible connections to astrophysical parameters. We retrain and use the flatwrm2 long-short term memory neural network to find stellar flares in 2-min cadence TESS light curves from the first five years of the mission (sectors 1-69). We scale these flares to a comparable standard shape, and use principal component analysis to describe their temporal morphology in a concise way. We investigate how the flare shapes change along the main sequence, and test whether individual flares hold any information about their host stars. We also apply similar techniques to solar flares, using extreme ultraviolet irradiation time series. Our final catalog contains ~120,000 flares on ~14,000 stars. Due to the strict filtering and the final manual vetting, this sample contains virtually no false positives, although at the expense of reduced completeness. Using this flare catalog, we detect a dependence of the average flare shape on the spectral type. These changes are not apparent for individual flares, only when averaging thousands of events. We find no strong clustering in the flare shape space. We create new analytical flare templates for different types of stars, present a technique to sample realistic flares, and a method to locate flares with similar shapes. The flare catalog, along with the extracted flare shapes, and the data used to train flatwrm2 are publicly available.