The 'Rome2Rio' site is usually pretty accurate: they quote €29-35 for a taxi to Atocha. There's also the C1 suburban train from the airport to Atocha that takes 27 minutes, leaving every 15-20 minutes from 6am (around €2), as well as the Expres Aeropuerto bus which costs €5 (trips to Atocha start from 6am, every 15 mins, you pay the driver in cash).
I remember reading elsewhere on this forum, however, that the easiest way of getting to Pamplona is to catch the Alsa bus directly from Madrid Barajas Airport. In that way you avoid a trip to the centre of Madrid. It takes 5 hours, and costs around €30. The bus station in Pamplona is in the centre of town.
If you arrive at Pamplona Renfe train station, there are local buses every 15 mins to the centre of town (€2). But Pamplona isn't that big, so it shouldn't be too far to walk! However if needed/ preferred, a taxi won't be that much, maybe €6 or €7.