@John ********
To ride a motorcycle in Thailand, and remain strictly within the law, you must possess and produce:
A national motorcycle drivers licence issued in your home country, valid for a motorcycle AND,
An International Driving Permit. *NB - Some members believe your home licence in English with a photo satisfies Thai law. In the end it is "up to you".
The maximum period that you can drive a hire car or bike legally on an IDP is 60 days on a Tourist Visa, 90 days on a Non-Immigrant O visa. For rentals in excess of that a Thai Driver's Licence is required. To obtain a Thai drivers license requires a formal in-person application, as well as hold and be admitted to Thailand on a non-immigrant visa status. This link to the the Department of Land Transportation website explains the procedure