Your question is badly phrased, so let’s rephrase it:
When you place an object in the world, what governs where it will appear on your screen and how big it is in pixels?
Your first mistake, talking in inches or cm of screen, obviously does not take into account different sized screens of the same resolution. I will leave that one, as generally, the application doesn’t care about such things. I think you mean, transforming your object in physical space into screen pixels, and letting the user decide how big a monitor they want to buy.
Even so, there isn’t a single answer to this question.
If you use glOrtho, then the projection is parallel:
glOrtho(0,5,0,3,-100,100);
I purposely made the z range big so you can forget it.
In this projection, if you plot a line:
glBegin(GL_LINES);
glVertex3f(0,0);
glVertex4f(2.5,0);
glEnd();
It will go from the left edge to halfway across the screen at the bottom.
Next, you can set the viewport with glViewpoint, which would limit which area of the screen your transform should apply.
glViewport(0,0,100,100);
glOrtho(0,5,0,3,-100,100);
would draw exactly the same thing as before, except that the “window” is now actually a 100x100 pixel square at the lower-left of your window.
Last, if you use gluLookat, glPerspective, etc, the object will be projected using 3d perspective onto the screen, so obviously the farther away it is, the smaller it gets. Yes, for the same perspective, if you have a wider window you will get a different number, and so yes, you do have to take the aspect ratio into account. See the red book for the canonical example, or for that matter most demos use gluLookat or gluPerspective. But the transformation is mapped onto the viewport, so it does in fact depend on window size.