I think it is true. And we assume those generators are homogeneous, otherwise, the ideal $(x,x^n+y)=(x,y)$ of $k[x,y]$ gives an example that degrees are not unique determined.
Write $I=I_1+I_2+I_3+\cdots$, where $I_k$ is the part with degree $k$ of $I$. Then $I$ is generated by the homogeneous elements of degree $1,2,3,...$. But view $I_1$ as $k$-vector space, we see that those generators of degree $1$ form a $k$-base of $I_1$, so the numbers of those generators of degree $1$ are unique. Similarly, in degree $2$, $I_2=(I_1S_1,f_{21},f_{22},\ldots)$ (as $k$-vector space). Since generators are minimal, those generators of degree $2$ are not in $I_1S_1$ and form a base of $I_2/I_1S_1$. (Here $S_i$ is the set of homogeneous polynomials of degree $i$.)
We can do this step by step to see that your claim is true.
Hence the number of the minimal generators of $I$ is $\sum_n\operatorname{dim}_kI_n/\sum_{i=1}^{n-1}I_iS_{n-i}$. (By Noetherian property, there are only finite terms in the sum.)
Edit: If we do not require the generators are homogeneous, the statement is not true in general.
In $k[x,y]$, ideal $J=(x+y^3,y^2+y^3,y^4)=(x,y^2)$ is a homogeneous ideal, let us verify that $\{x+y^3,y^2+y^3,y^4\}$ is a minimal generating set.
If $I= (x+y^3,y^4)$, then $I=(x+y^3,y^4,x)=(x,y^3)$, contradiction. If $I=(x+y^3,y^2+y^3)$, then there exist $f,g\in k[x,y]$ such that $x=(x+y^3)f+(y^2+y^3)g$, let $x=1,y=-1$, we will get $1=0$, also contradiction.