Da Giora, Lonely Planet forum:

If you arrive at the border with no visa previously purchased, you will be sold a 3 day transit visa. It is NOT possible to extend this visa in Nouadhibou, you have to travel down to Nouakchott for the extension (I've been told it might be possible to extend it in Atar, but can't verify this personally). The transit visa costs 10 Euros or 100 dirham, and the extension costs 5000 Ougs (...or at least that's what i managed to haggle it down to...). The extension is for a month, although you can get a longer extension if you pay more (3 months for 10,000 Ougs). It sounds like less hassle getting the visa beforehand in Casa, although be warned that the visas they issue there start ticking on the date they're issued, and not on the date you enter Mauritania.

Hope the info saves someone a bit of time and hassle...