MS stands for Model Series, and the four digits do two jobs: the first is the frame, the next three are the model. 5001 is a Frame 5, single shaft; 5002 is a Frame 5 with two shafts. Letters tacked on the end are revision levels, and usually the later the letter, the more power the machine makes. The exception that catches people out is the 5001P and 5001R. The P came as an upgrade to the N, which was itself an upgrade of the M: the N got a better compressor section with variable inlet guide vanes, and the P changed the turbine section and moved to Mark II controls where the N ran Mark I. The R, oddly, is basically an M with Mark II controls and the same turbine changes as the P. So a later letter does not always build on the one before it.
PG is short for Power Generator, and it is just an MS model with the two zeros swapped for the turbine's approximate horsepower. A PG5341P is an MS5001P rated at around 34,000 hp, which is about 25 MW. That is why the same machine turns up under two names in listings, and why the two numbers have to agree: MS tells you the frame and revision, PG tells you roughly what it produces. If you are comparing units, get both before you talk price.