The size, population and location of Gravity Falls, Roadkill County, Oregon, is (probably intentionally) left vague and at times contradictory.
First of all, as to why the town has so many facilities for its size, remember that it's a tourist attraction. We see a lot of tourists pouring into the town throughout the show, judging from the visits the Mystery Shack (the town's tourist trap) receives.
The high school doesn't look too big to me. High school is usually either grades 9–12 or 10–12, according to Wikipedia (I'm not American and am not too familiar with the school system there), but sometimes even grades 7–12 (random example from Oregon: South Wasco County High School). It's hard to say how many classrooms the building contains, but it could very well be one class per grade.
According to the Gravity Falls wiki and reddit, we encounter 370 characters living in the town. The real population is probably higher, though.
As to the size of the town itself, we have some aerial views of the town that give a better indication than the first picture in your question.
From the first episode of the second season, "Scary-oke":

Although this appears in the show and should be canon of the first class, it makes the town seem very small, and contradicts other sources that have more buildings.
We also have a couple of maps of the town. Here's one from the book Dipper's and Mabel's Guide to Mystery and Nonstop Fun!:

As you can see, this one adds a few buildings between the Mystery Shack and the town square that also appear in the show, like Greasy's Diner, Gleeful's Used Car lot and the Dusk 2 Dawn Convenience Store (as well as a lot more buildings in the area of the water tower and convenience store).
Here's a reference map used by the show's creators which also makes it larger than the first overview image:

To try to add some measurement of distance to the maps and bird's eye views, we have some information from the show. From season 2's eighth episode, "Blendin's Game", we learn that the Mystery Shack is located 1 mile from the town centre:

From season 1, episode 20, "Gideon Rises", we see that the "town border" is 10 miles from the waterfall, making the town fairly large but mostly uninhabited forest land:

Do we have any other avenues to figure out the population? Well, it's hardly scientific, but we can take a look at the prison population. Gravity Falls Maximum Security Prison is quite large:

It's a State Prison, so there might be inmates here from neighboring towns and cities, but its name suggests it's located in Gravity Falls. Let's assume most of its inmates are from there. We see eleven inmates in the show, including Gideon.

According to the National Institute of Corrections, Oregon imprisons 385 people per 100,000 in state prison. This gives us a total population of 2857 in the pool the prisoners are taken from. Wikipedia, however, has Oregon at 582 per 100,000 inhabitants of all ages (Gideon is a kid), which gives us 1890 people, and 740 per 100,000 adults which gives 1486 people. This is of course highly approximate, but I had fun thinking of different angles to figure out the population.
Like another answer tried, we can also try to pinpoint where Gravity Falls is located in Oregon to find real-life equivalents. We are given two locations of the town in Oregon. These two locations are kind of contradictory, but at least we know that Gravity Falls is located latitudinally near the center of Oregon. The first is from a stylized map from the very first episode, "Tourist Trapped":

(The highlighted area in the middle there is probably not Gravity Falls, but (the equally fictitious) Roadkill County, in which the town lies.) This location suggests it might be in the vicinity of the Bend, Oregon Metropolitan Statistical Area; South of Mt Hood, East of Corvallis (or Corvalis?), North-East of two pine cones which might signify La Pine; which fits topographically with pine forests, mountains and rivers, was settled by Native Americans (as we know, Gravity Falls was shunned by natives, who considered it cursed land) as well as a low population density. Fitting towns/cities here are Three Rivers (pop. 3000) and Sisters (pop. 2000).
Just for fun, although it doesn't give us any real-life locations to match it with, reddit estimates this location (partly based on the animal head representing the real-life town of Antelope, although I don't think those are antelope horns!):

The second is from the first episode of the second season, "Scary-oke" (right before it zooms in to the bird's eye view at the top of my answer):

This makes less sense to me, both topographically, and by looking at nearby real-life locations. It puts Gravity Falls near the Malheur National Forest.
As Valorum pointed out in a comment, show creator Alex Hirsch based Gravity Falls on the actual city of Boring, Oregon, which has a population of approximately 8000. However, Hirsch never actually set foot in Boring, he just modeled Gravity Falls on what he thought it would be like there. Boring does not fit the given location(s) of Gravity Falls, being located near Portland.
At the end of the second season,
the evil Bill Cipher is turned to stone and left as an inert statue in the woods.
In 2016, an alternate reality game (ARG) became a scavenger hunt, as Hirsch revealed that this object was hidden in the real world. In August 2016, fans found it in Reedsport, Oregon. Reedsport is located far off the given location(s) of Gravity Falls, and we don't know if the object in the series ends up in the Gravity Falls woods or somewhere else, but Reedsport has a population of about 4000, which might be something.