I want to root my Nexus 6 which is on Android M, would it be enough to flash TWRP and then SuperSU, or would I have to flash a specific kernel to root it? Also is TWRP 188.8.131.52 compatible with Android M?
For rooting your phone I found this nice guide (5/29/2015) with links to all necessary files. In the guide they are using TWRP 2.8.5, but since 2.8.6 is out it should work as well. If it doesn't work, just flash the version in the guide. SuperSU 2.46 is being used in the guide. Also remember that Android M (MPZ44Q) is only a developer preview, so it isn't a fully implemented release.
As far your kernel, NO you don't need a custom kernel. Only with a custom ROM, would that be necessary.
Make sure your bootloader is unlocked
fastboot oem unlock
Root/rooting - gaining administrative control
Recovery - aids in administration, plus backups, sideloads , and etc.
Kernel - tells the hardware what to do, custom kernels allow changing variables
Boot image - preps the system for the ROM
ROM - the devices operating system
1. Perform a backup
2. Unlocking boot loader will ERASE/WIPE/DELETE everything
3. YOU assume all responsibility in rooting your Nexus
Custom recovery and super user is all that is required. There is no need to flash a custom kernel for root. Also twrp 2.8.6 will work with the m preview but if you want to run a rooted m preview I suggest you download a rooted version from Xda. I suggest doing that way just so you will run into less issues. Make sure you read the posts on Xda forums and if you have any questions ask those guys Xda is a wonderful community!