This is somewhat of a partial answer.
Suppose, as in your specific example, that $g(X)$ is coprime to $X$ and irreducible.
Let $t=deg(g)$. Since $g(X)$ is irreducible, adjoining any of its roots generates the unique field of degree $2^t$ over $\mathbb{F}_2$, i.e. $\mathbb{F}_{2^t}$. Since this is also known to be the set of roots of $X^{2^t}-X$, we have $g(X)|X^{2^t}-X$. Therefore it is always true that $g(X)|X^{2^{deg(g)}-1}-1$.
On the other hand, it is well known that $gcd(X^n-1,X^m-1)=X^{gcd(m,n)}-1$. Therefore the minimal polynomial of the form $X^n-1$ that $g$ divides has $n\mid2^{deg(g)}-1$.
In general, I don't think we can do any better than this: considering the roots of $g(X)$ as elements of the cyclic group $\mathbb{F}_{2^{deg(g)}}^{\times}$, they all have the same order, seeing as they are conjugates via Frobenius, and $2$ is prime to $\#\mathbb{F}_{2^{deg(g)}}^{\times}$. Therefore, for example, knowing whether this minimal $n$ is $2^{deg(g)}-1$ is like knowing whether the roots of $g(X)$ are generators of the multiplicative group. I don't know of a general way of answering this question without checking this explicitly for the polynomial.
So, in your example, $g(X)$ divides $X^{2^{15}-1}-1$, and to check it doesn't divide any lower power you only need to check that $X^{m}-1\neq 0 (\text{ mod } g(X))$ for $m\neq 2^{15}-1$ dividing $2^{15}-1$.