The degrees of freedom (DF) are the amount of information your data provide that you can "spend" to estimate the values of unknown population parameters, and calculate the variability of these estimates. This value is determined by the number of observations in your sample. Increasing your sample size provides more information about the population, and thus increases the degrees of freedom in your data.
The 1-sample t-test estimates only one parameter: the population mean. The sample size of n constitutes n pieces of information for estimating the population mean and its variability. One degree of freedom is spent estimating the mean, and the remaining n-1 degrees of freedom estimate variability. Therefore, a 1-sample t-test uses a t-distribution with n-1 degrees of freedom