Your answer are correct, for the proof we'll need few facts.
I'll assume you know the handshaking lemma $\sum_V d^°(v) = 2|E|$ (the sum over all vertices of the degrees is two times the number of edges) ; and the characterization of trees with $n$ vertices as connected graphs with exactly $n-1$ edges
- there are no trees without degree one nodes
to prove this take a tree without degree one nodes, we first remark that no vertex can have degree $0$ (otherwise the graph is not connected, so it is not a tree), hence we assume all nodes have all degree at least $2$. Then we use the handshaking lemma: $2|E| = \sum_V d^°(v) \leq \sum_V 2 = 2n$, hence the graph would have at least $n$ edges, so it would not be a tree.
- there are no trees with only one degree one node
to prove this, we proceed by induction: from a tree $T$ with a single degree one vertex $s$, we construct a new tree $T\setminus \{s\}$ by deleting $s$. We get a tree with exactly one less vertex and one less edge. Since we only have a finite number of vertices, the induction stops at some point, and we end up with a tree without degree one vertex, which is impossible as we've just proved.
- there are no trees with $n=|V|$ degree one edges (other than the path with 2 vertex $P_2$)
here we also use the handshaking lemma: $2|E| = \sum_V d^°(v) = |V| = n$ so $2(n-1)=n$ hence $n=2$.
Now we have lower and upper bound that your examples match: the paths have exactly 2 degree one vertices and the stars have exactly $n-1=|V|-1$ degree one vertices.