M for metric.
The first number is outside diameter. For example, an M5 screw is 5mm in diameter.
The next number is length. An M5x20 bolt is 20mm long.
There may also be multiple thread options for larger sizes. M8 threads come with 1.25mm between threads and 1.0mm.