OpenGL expects the vertex positions you give to be in "clip space"... which is the same as "NDC space" before the perspective division.
In 2D, you won't have perspective division, so you can think of clip space and NDC space as the same thing.
X=-1 is the left edge of the screen
X=+1 is the right edge
Y=-1 is the bottom
Y=+1 is the top
These are the cords OpenGL expects to get regardless of your window size. So if you are outputting positions that have X=10 because you want your object to be 10 pixels wide... that is wrong because X=10 is waaaaaaay offscreen.
You need to transform/scale your output positions to conform to NDC space. This is usually done by multiplying the positions by some kind of projection matrix. In modern OpenGL this would be done by your vertex shader.
Though I really recommend you read that arcsynthesis tutorial I linked. I can give you the magical math you need to make this work, but reading that tutorial will explain how it all works and you'll be able to come up with this on your own.
If you want to make it easier on yourself, you can use the openGL math library (glm) to make vector and matrix math easier. It's also a header only lib, so you don't have to worry about linking.
It's good to learn how it all works beforehand, so that you understand what you're doing though.
1 2 3 4 5
glm::mat4 scale_mat = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
//this gets you a transformation matrix which will scale a 3d vector by .5
glm::mat4 scale_mat = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f, .1f, .3f));
//this gets matrix for scaling by .5 in x dim, .1 in y dim, and .3 in z dim
glm also has the functionality to make perspective matrices, view matrices, rotation matrices, translation matrices, and so forth. What's nice about it is that the operators such as +, -, *, and /, are overloaded to do the appropriate math when multiplying vectors/matrices/scalars.