@Kri****
, I use Green Bus there and back... typically I depart 8:00 (VIP seat) from Chiang Mai and take the 14:30 bus back. That gives you about 2 hours in Mae Sai to get to the border via song Theaw (15 baht), stamp out, stamp in/out of Myanmar, stamp into Thailand, get some lunch and song theaw back to the bus station. You are permitted to go into Myanmar for a little shopping if you have the time and want to look around. The agent at the border will ask you if you plan to go shop (in which case they will keep your passport and give you a receipt to retrieve your passport on the way out) or, just head back into Thailand.
Bus tickets can be purchase on the Green Bus website (recommend you use VIP seats) and you can pay for the bus ticket at 7-11. The 7-11 receipt is your ticket. Just make sure you go to the correct bus station (Arcade Bus Station East of the city).