Mobile phones in Thailand have 10 digits, including the leading zero. Land-line telephones have 9 digits, including the leading zero.
To place an international call, you can buy a prepaid card (available for 300 baht at many convenience stores and guesthouses) to use with one of the bright yellow Lenso payphones. You should rarely have trouble finding either of these unless you're way out in the countryside. The international access code is 001.
For mobile phone users, Thailand has three GSM mobile service providers: AIS, DTAC and TrueMove), which may be useful if you have a mobile phone that will work on either one or both of the GSM 900 or 1800 frequency bands (consult your phone's technical specifications). If you have one, you can buy a prepaid SIM card for any of the Thai carriers in any convenience store for as little as 50-200 baht and charge it up as you go. The Bangkok airport is a good place to buy a SIM card, since the people working at the counters there speak relatively good English. Since 2015 you must provide your passport details when buying a SIM card.
Most phones sold by major carriers are "locked" to the carrier. That means that the phone won't work with a SIM card on another network, unless you get it unlocked. Unlocking a phone involves entering a special code into the phone. The procedure for entering this code depends on the specific phone. Most carriers will give you the unlock code, and instructions on how to unlock it, if you have been a subscriber in good standing (bills paid) for a certain period (about 3 months, but depends on the carrier). Contact your carrier's customer service department, and tell them you plan to use your phone overseas. They will usually give you the unlock code. Once unlocked, you can use any SIM card in the phone. Alternatively, the wizards at Bangkok's MBK shopping mall can unlock most phones for less than 500 baht. If you need to buy a mobile phone, you can pick those up at MBK as well, as a huge selection of cheap second-hand mobiles can be found on the 4th floor.
International rates from Thai carriers are surprisingly good. DTAC, for example, charges 10 baht/minute to call the USA. Moreover, you can reduce rates even further, from 1.5x and up to 5-6x for some countries like Russia, by pre-dialing 009 or 008 instead of + before the international country code. For instance, 009 1(xxx)xxx-xxxx for the USA will give you a 5 baht/minute rate, at the expense of slight voice quality decrease, which is often unnoticeable.
TrueMove offers very good international call rates from 1 baht per minute to destinations including the USA, Canada, Australia, UK, France, and Germany with its Inter-SIM promotion. You may find the SIM cards handed out for free at some airports, branded as an AOT SIM and including 5 minutes of free calls back home. You should also use prefixes (006 for better quality, 00600 for a cheaper rate. However, for some countries, the rate is same for both promotions. How to get cheaper rates, as well as rates for selected countries, is clearly listed on SIM card packages.
Coverage is very good throughout the country, all cities and tourist destinations (including resort islands) are well covered, and even in the countryside it's more likely you'll get a network signal than not, especially with an AIS or DTAC SIM. However, if you plan extended stays in remote non-tourist areas, AIS (their prepaid service name is "1-2-Call") is a better choice, at the expense of more pricey local calls than DTAC. But the difference, once very significant, is becoming less and less over time, both in call rates and coverage. TrueMove coverage is considered the worst, with phones occasionally losing signal even in towns. Nevertheless, if you plan to stay only in major cities/islands, and/or don't need your phone available all the time when outside of them, True SIM is OK too. As a benefit, now they have 3G (850 MHz only). Not all handsets, especially older ones, support this band. Coverage in Bangkok (centre, airport and some other areas), Chiang Mai (entire city), Phuket, and Pattaya.
If you plan to visit Thailand at least once a year for short visits, consider buying the SIM with minimal validity restrictions (usually one year from the last top up, even if it was 10 baht). By doing this, you can re-use this SIM on the next trip, thus avoiding hassle of buying a new one every time, keeping your Thai number the same, as well as saving a bit. For example, DTAC offers the Simple SIM plan for that, and before 7-Elevens sold this one by default, but now they seem to offer cheaper (but with limited validity) Happy SIMs instead. Just ask for the former one. Local calls will be a bit more pricey (international are not affected), but usually this is not of much concern for the short-time visitor. AIS (1-2-Call) has similar (but more expensive) offerings too, as well as True. If you already have a Thai SIM and want to switch plans, that is possible for free or with at a small charge. Consult your operator's website for details.
For short-term visitors, international roaming onto Thailand's GSM networks is possible, subject to agreements between operators.
A smart phone is an incredibly useful thing to have while travelling. All three big GSM operators offer nationwide GPRS/EDGE and 3G service with 4G already rolled out in major tourist towns. They all offer a bewildering number of SIM card and add-on service packages and competition keeps changing what is available. If you just want to get connected it is enough to know that all three operators cover the country well enough and the prices are not far apart. If you visit for some weeks it is good enough to buy one of the packages offered to tourists at the mobile operator shop that has the shortest queue. AIS has "Traveller SIM", DTAC has "Tourist SIM" and TRUE has "TOURIST SIM". As of 2016 you will pay 299-599 baht to get 7-15 days of unlimited mobile data and call credit enough for over an hour of local calls. You can buy additional data packages if you stay several weeks. Meticulous research can pay off if you stay for months, want to use the same phone number for years, upload gigabytes of videos or simply insist on paying nothing but the lowest possible price for your kind of usage.
However, depending on the amount of data needed, the Tourist/Traveler SIM may come too expensive. There are many other options (e.g. new dtac SIM card with 600 MB/7 days data package costs less than THB 130); refer to Prepaid Data SIM Card Wiki - Thailand for the overview of the packages available and current pricing for all operators.
From 2014 all the operators offer 3G WCDMA at the standard 2100 MHz band in addition to the less common 850 and 900 MHz bands. As a result your device will work whichever operator you choose.
Usually data service is already pre-activated on a prepaid SIM. Internet usage is billed by the minute. Any minute within which your phone accesses the Internet is billed to you. The price of this pay-as-you-use access is not cheap, around 0.5 to 1 baht/minute. That is comparable to Internet cafes. However, Internet packages can be purchased, which can save you quite a lot, especially if you use this service often. These come in three types: time-based (good for laptop users who are on-line just a couple of hours a day), volume-based (appropriate for smartphones or chatting) and unlimited. See this useful guide to 3G data plans in Thailand.
Many smartphones will access the Internet in the background, even when you're not actually using the phone or the Internet. This can eat up your minutes quickly, and then will start to consume your remaining baht much faster,if you have a time-based package. It's best to use either volume-based or unlimited package in this case. Alternatively, make sure your phone has a reliable way of turning off the Internet usage.
Some smart phones may require you to manually enter the APN (Access Point Name) for the Internet to work. APNs have many configurable parameters, but typically only a few pieces of data are necessary. Check your phone's settings; the procedure for editing APNs varies for different phones.
Topping up an Internet package isn't as straightforward as topping up voice minutes, but not impossible even if you can't speak Thai. While you can easily top up voice minutes at any convenience store, you will likely get a blank stare if you ask for Internet packages. Internet packages can be topped up at cell phone stores, which are easy enough to find in populated areas - however, it is not likely that they'll be aware of all current promotions and options. More services, obviously, will be available at numerous operator's outlets (DTAC shop, TRUE shop, AIS shop, TeleWiz shop for AIS) generally available at the big malls/trade centres (Big C, Tesco, etc.) as well as other public places - refer to your operator's website for details. Alternatively, you can just call the customer support (1678 for DTAC, 1331 for True, 1175 for AIS) - they can both advice you about the nearest office location, if you still need it, or turn off/on any Internet (or SMS or MMS) package you request. However, calls to these service numbers often aren't free for prepaid SIM users, with calling rate up to (DTAC) 3 baht/minute. If you do not want to spend that every time you need to switch - there are numbers where you can do-it-yourself using a voice menu (free of charge): *1004 for DTAC Happy (Thai language only), *9000 for True (in English, at least for the Inter-SIM handed out in the airports).