Typically, graph problems don't depend on the "names" of the vertices. Finding a route from Paris to Berlin doesn't get any easier or harder if you rename the cities Sirap and Nilreb, or 6 and 32, or anything else. Indeed, in many cases, the vertices of the graph don't even have explicit names: they're just a set. Since changing the names of the vertices makes no difference, an algorithm doesn't become less powerful by assuming that the names are $1, \dots, n$, where $n$ is the total number of vertices. That is, there is no loss of generality in doing this.
$1, \dots, n$ is a useful choice of names because computers are good at dealing with numbers and because, typically, the vertices will be stored in some kind of array anyway (an array of adjacency lists or just an adjacency matrix). It makes sense to name the vertex after the array cell it occupies, so that the algorithm never has to worry about the distinction between "vertex $x$" and "the place where vertex $x$ is stored".