Kazakh visas all need an Letter of Invitation and it is probably best to apply in your own country. You can in theory get a visa on arrival at the airport as long as you have a visa on arrival LOI which is available from Stan Tours although it costs more than the standard LOI. David at Stan Tours will offer you good and quick advice.
Visas are all valid for 30 days and cannot be extended in any way
Kazakh Embassies in surrounding countries:
There are embassies in Kyrgyzstan, Uzbekistan, Iran, Tajikistan, Turkmenistan where you can get a visa but for all of them you will need an LOI.
You can generally enter Kazakhstan without onward visas as it is possible to get so many visas in Almaty or in Astana (the capital)
Routes out of Kazakhstan:
Russia: Many routes out to the North, we used the Semeypolatinsk border post and it was very easy.
China: You can enter China to the East of Almaty with no trouble.
Kyrgyzstan: Several routes in, but be careful if you go over the mountains to Lake Issy Kul as if you don’t get your passport stamped you could have lots of hassle.
Uzbekistan: several routes in all with no trouble.