Google announced through a Blog at their post and official twitter handle, Android M has got its name.
— Android (@Android) August 17, 2015
As Android version 5.X is named as Android L which means Android Lollipop. Just after the release of Android L, Google has been working on newer version which was code-named Android M and already got two preview builds for Nexus devices. Now Google Android M is Android Marshmallow.