At a beginner's level, you can think of a reference frame as being the same as a co-ordinate system (if you get into relativity and differential geometry there are some technical differences, but at a beginner's level you don't need to worry about them).
A reference frame or a co-ordinate system is a way of assigning a set of numbers or co-ordinates to each point in space (or to each event, which is a point in spacetime) so that no two points have the same co-ordinates. We can then, for example, express the motion of a particle by giving the parametric equation of the line that the particle follows in space (or, if dealing with spacetime, we would give an equation for the world line of the particle). The laws of physics can then be expressed as constraints on the equations of the lines (or world lines) that particles can follow.
The two co-ordinate systems in your diagram assign different co-ordinates to each point in space (apart from the origin, which has co-ordinates $(0,0,0)$ in both co-ordinate systems). So they represent two different reference frames. Given a point $P$ in space, we can convert $P$'s co-ordinates in one reference frame $(X,Y,Z)$ to its co-ordinates in the other reference frame $(x,y,z)$ and vice versa. In this case, since both co-ordinate systems are Cartesian reference frames, the relationship between $(X,Y,Z)$ and $(x,y,z)$ is a linear relationship and can be represented by a matrix. Note that this is not always the case - converting between Cartesian and spherical co-ordinates, for example, is a non-linear process.
Finally, yes, if we move the origin from $O$ to some other point $O'$ then we change the co-ordinates assigned to a given point, so we have a different reference frame.