I'll break this up into two parts:
Stay of 5 days or less
1. No requirement to register
2. Regardless of arrival by airplane or over land border
Stay of more than 5 days
1. Some countries (like Malaysia) are allowed 15 days visa-free in Kazakhstan. BUT this only applies if you fly into Astana or Almaty i.e. go through immigration at the airport and obtain TWO stamps on your white coloured migration card. See below for pics.
2. If you're arriving via a land border e.g. Kyrgyzstan-Kazakhstan, Uzbekistan-Kazakhstan, you will only receive ONE stamp on your white coloured migration card. You must register yourself with the migration police to get the second stamp.
Procedure for registration at migration police
1. Check to see where their office is. It's at 29 Seyfulin in Astana and 86 Karasay Batyr in Almaty.
2. Walk straight to the registration counter - it should have a sign saying "registration" or "регистрация" in Cyrillic. It's counter No.7 in the Astana office and counter No. 3 in the Almaty office. Ignore the long line of people at the counter for forms outside.
3. Depending on your luck, the officer will fill in the form for you, or you will need to fill in a form (100% in Cyrillic) yourself. If it's the second case, refer below for helpful translation.
4. I was not asked for photocopies of my passport, but it's a good idea to bring one along. In any case, there are always photo-taking and photo-copy shops near the migration police office.
5. The whole process only took 15 mins for me. But it could take up to a day.
6. I went one day an hour before closing and the place was packed. The second time I went just after lunchtime and it was much more manageable.
Sounds easy right? Well, only because it took me two visits to work this out. The migration police office is super crowded and no one speaks any English, expect for maybe one officer - the key is to find this person. I did the civilised thing and lined up for a form, only to discover that they had given me the wrong one after I brought it back to the hostel to be translated by a friend.
Lesson learnt. I marched back into the office the following day brandishing my laptop and a picture of the correct form on it. I was immediately pointed in the right direction. Seems like the more obvious you make it you're a foreigner, the better the outcome. Don't bother being all polite and asking in broken Russian. Also, in a huge crowd, try to differentiate yourself. Waving a laptop above my head got me noticed in 5 seconds. There may be other ways. Be creative.
What happens if you "forget"?
Well, it really depends on whether you get checked, and if you get let off (unlikely). Otherwise they have been known to impose a fine (USD200) and/or delay you until you miss your flight/train/bus. Just get it done. Why risk it.
Here are the two documents you'll need to take note of:
I have read that if you ask really nicely in Russian at the land border, and/or you're devastatingly good looking, it's possible to get two stamps. I don't know because the land border I crossed was really busy and there wasn't any time to explore this.