This sonnet first appeared in Milton's 1673 collection of Poems simply as the nineteenth sonnet in the collection, or Sonnet XIX. Many readers, including us, refer to it by the first line, "When I consider how my light is spent." Identifying a poem by the first line is standard practice in the poetry world.
But, many more readers refer to the poem as, "On His Blindness." The problem with this title is that it didn't come from Milton. It was given almost a hundred years later by Bishop Newton, a writer and clergyman (source). Now, almost everyone agrees that the poem is most likely about Milton's blindness, but Milton never says so up front, leaving the door open for some interesting ambiguity. If Milton had wanted to say, "Hey, guys, this poem is about my blindness!" he could easily have done so. Newton's invented title changes the way you read the poem, which is why we prefer to use the first line of the poem.