The stock size is something you specify when you generate the G-code in your CAM package (Fusion360, Inventor/HSM, Carbide Create, MeshCAM, etc)
Summary of the workflow:
When you set up to generate the G-code, you specify the stock size, position of the part in the stock, and where the origin should be set.
When you mount the stock in the machine, you position it wherever it needs to be (based on how you are mounting it and access. For example, you may be mounting the stock in a vise that is in a fixed position on the machine bed), with the orientation as specified when you produced the G-gode.
You then zero the machine so the machine zero matches the appropriate point on the stock, wherever that point is.
I try to specify Z=0 at the top of the stock, and have my Y=0 at the front so I can see it during setup. X=0 is usually one end or the other, unless I have a good reason to put it in the middle. There are a few fixtures I use where I can zero on the fixture before mounting stock, so the origin is set to a point on the fixture, instead. I need to account for that when generating the G-code.