If my graphics card has a limitation of 512 work-items per work-group and I’m modelling a 2-dimensional problem, that means the multiplication of the local size I chose for each dimension can be no more that 512 right? Like 16*32, 64*8, etc.

That’s right. See section 5.6 of the spec.