Nukunonu has a small hotel, but on Fakaofo and Atafu you'll have to stay with a local family. This should be arranged in advance through the Tokelau Apia Liaison Office in Samoa. They'll forward your request to the respective island council and you'll pay a set amount per person a day for food and accommodations.
You could also write in advance to the faipule or pulenuku of the island of your choice to let them know your intentions—having a contact or local friend makes everything easier. Once your stay has been approved, the Tokelau Apia Liaison Office will give you a visa application to complete and collect a processing fee.
When you go, take along a bottle of spirits for whomever made the arrangements, as well as gifts for the family. Suggested items are rubber thongs, housewares, tools, fishing gear (stainless steel fishhooks, fishing line, swivels, sinkers, lures, mask and snorkel, and spear-gun rubbers), and perhaps a rugby ball or volleyball. The women will appreciate perfumes, deodorants, cosmetics, printed cloth, and dyes. Kitchen knives and enamel mugs are always welcome.
You'll probably have to sleep on the floor and use communal toilets over the lagoon—there'll be little or no privacy. Still, the facilities are of a much higher standard than in comparable Samoan villages. Most families own land on one of the motus, so you could spend a few days camping on your own if you have a tent and a large enough water container. Before you leave an atoll where you've stayed between ships, you could receive a "summons" from the council of elders at which you'll be asked to explain the purpose of your visit. If you give the right answers you could be honored with a traditional gift.