If you want to travel between Malaysia and Thailand using public transport, then the Padang Besar Border is the best place to go to if you are heading to or from either Penang, Langkawi or Kuala Lumpur from or to Hat Yai in Thailand.
There is another border checkpoint at Bukit Kayu Hitam / Sadao, but that offers little chance for public transport, with the nearest bus stopping at Changlun in Malaysia, some 8 kilometres from the border.
The only way to get to Changlun from Bukit Kayu Hitam is by taxi.
So, to save money and do it all by cheap bus or the new KTM Komuter Train, head to the Padang Besar border crossing.
For those that just want to get to Penang as quick as possible you can get a minibus from Hat Yai which crosses into Malaysia at the Sadao / Bukit Kayu Hitam border crossing, then travels down Highway 1, straight to Penang.
Another option is to travel by train between Hat Yai and Butterworth.
You can reach the border by local bus from Hat Yai or buses from towns south of Padang Besar in Malaysia.
At the border, simply get your passport stamped out of Thailand, then walk straight for about 100 metres and turn right down the hill.
The walk in no man's land is not too far and is easily done in 5 - 10 minutes. Otherwise you can hire a motorbike taxi to do the trip, but for most people it is not really worth it.
On the way you can drop into the fairly large duty free shopping outlet half way down the hill.
This place is very popular with Malaysians as they can stock up on cheap booze and cigarettes, which are much more expensive in Malaysia than they are in Thailand.
They also sell a wide range of other duty free goods, such as perfumes, watches, baggage, chocolates and clothing.
When you get to the bottom of the hill, the Malaysian border checkpoint / immigration is on your left.
Take the first road in and go to the first booth on your left.
There are no forms to fill in and most Nationalities get a 90 days entry visa (please check your own countries Malaysian visa rules).
If you are going the other way into Thailand you have to get a form first from the booth and fill it out.
You will only get a 15 or 30 days visa, unless
you have obtained a visa beforehand at a Thai embassy or consulate.
You can get one in Penang at the Thai Consulate.
Update for 2018:
As a non Thai or Malay, you now have to go into an office (on the left) to get your passport stamped.
Get you form first from the main immigration officers (just go to the front of the line and ask).
Fill it in, then go to the office.
Warning: In December 2017, I (and every other foreigner at the Thai immigration while I was there), was asked to show cash money by the immigration officer before being allowed into Thailand.
The amount you have to show (per person) is:
10,000 Thai Baht (or other currency equivalent) for a visa on entry - ie 15 or 30 days.
20,000 Thai Baht (or other currency equivalent) for those holding a 60 day Thai visa.
This has always been a rule, but very rarely enforced in the past and may well not be enforced in the future.
But to ensure you have no problems, make sure you have the cash on you when crossing into Thailand.
When you leave the border area you will now be in Padang Besar Malaysia. Just outside is a large roundabout with flagpoles. Keep to the right and walk around, then straight ahead to the bus stop.
The Padang Besar train station is also close by.
There are stairs that lead up and over the tracks on your right, just after you get you passport stamped into Malaysia.
There is a money changer here (now closed), but he would probably only be open when trains come in, so it is best to have changed a small amount of money up before crossing the border.
It is is now much easier to catch a train from Padang Besar rather than the bus.
There are now many KTM Komuter trains a day heading south to Butterworth Penang.
Once you have cleared Thai immigration, you can either:
Catch a local bus to Hat Yai city centre or Hat Yai bus station from the bus stop across the road on your right.
Turn left and walk into town where there is a minibus station with regular vans to Hat Yai bus station.
The minibus station can be walked to in around 10 minutes - walk down the hill, turn left at the traffic lights, then take a right at the Fresh Mart (near a row of banks).
There are also a couple of Shuttle Trains a day to Hat Yai Railway Station from the Padang Besar Railway Station.
These trains originate from Padang Besar Station in Malaysia, so if you want to take the train it is easier to do your immigration procedures at the train station in Malaysia.
If you do want to catch the train from the Thai side, the station can be reached in five minutes by:
turning left when leaving the immigration area, walk down the hill into town, cross the railway tracks and turn left - you will see the station from there.
The border is open daily from 06:00 until 22:00 (Malaysian time) - 05:00 until 21:00 (Thai time).