Let $M$ be a connected oriented closed manifold. We know $[M,S^n]$ is isomorphic to the group of cobordism classes of framed 0-dimensional submanifolds of $M$. A framed 0-dimensional submanifold of $M$ is a set of points in $M$ with an isomorphism $T_xM \cong \Bbb R^n$ at each. A single framed point is cobordant to the same point with a different framing if and only if the orientations agree; this is because $GL_n(\Bbb R)$ has two connected components and the manifold is oriented.
So there is a map $[M,S^n] \to \Bbb Z$ given by counting points (with orientation). I claim it's an isomorphism. It suffices to show that every framed 0-submanifold can be chosen so that it's either empty, or every point has the same orientation (positive or negative). For if there's a positively oriented point and a negatively oriented point, pick a path between them (that doesn't pass through of the other points) and frame the normal bundle of the path (which is trivial, as an interval is contractible); if you choose this to agree with the framing at the starting point, then by the assumption that the first point has a different orientation to the second point, the framing on the path agrees at both points. So if we have points whose orientations disagree, we can null-bord them both out of the picture, as desired.
This is slightly more subtle in the case of $n=1$, which I won't talk about (and in any case you can prove much more easily by hand).
In the nonorientable case, this falls apart in the first paragraph: every point is framed bordant to itself with the opposite orientation. Thus you can't just cancel points with the opposite orientation; you can cancel any pair of points, making the only well-defined invariant "number of points mod 2".