The license only applies to the commit on which you committed the license, and any subsequent commits (assuming the subsequent commits do not change the license). For example, let's say you commit code as follows:
- Commit 1 (January 2019) - Added basic functionality.
- Commit 2 (February 2019) - Bug fixes.
- Commit 3 (March 2019) - Added frobulator functionality.
- Commit 4 (April 2019) - Bug fixes to frobulator functionality.
- Commit 5 (May 2019) - Added LICENSE stating that all files are under license X.
- Commit 6 (June 2019) - Edited text for spelling, grammar and punctuation.
In this situation, the license X applies to commit 5, commit 6, and any other subsequent commit which does not change the license. Anyone who got commit 4 or earlier is not allowed to use the software under license X.
In general, if there is no license mentioned, as in the case of commits 1 through 4 in the above fictitious example, then you should refer to What can I assume if a publicly published project has no license?
Specifically for GitHub, however, if a project has no license mentioned, the GitHub terms of service state that if you've posted a project publicly on GitHub, then you are implicitly at least giving permission to users to look at the code and to fork it (i.e. to use the GitHub fork functionality). This would apply specifically to commits 1 through 4 of the above fictitious example.