Hi, cclala, I am going to suggest that since you will be arriving in early evening, you should consider staying somewhere where there is good street life, restaurants, cafes, etc. I don't know if you've been to Spain before, but you will find that there is a very lively street scene, with dinner starting at the VERY earliest at 8:30 or 9 pm. I would also suggest that you be either in walking distance to Atocha or close to Puerta del Sol, because that's just a short one stop on the Cercanias train to Atocha.
Puerta del Sol is the big downtown center, lots of shops, lots of pickpockets. Easy to walk to the Plaza Mayor and very old Madrid, and also easy to walk to the Royal Palace and the Opera area. Hostal Persal is pretty close to Sol near a very pretty plaza and is a favorite for people at the end of their camino. I've stayed there a number of times.
There are lots of pensions near Atocha, and it's very close to the Retiro Park, which is lovely. A couple of forum members have stayed in that neighborhood.
https://www.caminodesantiago.me/community/threads/favorite-albergues-in-madrid.17477/
I very much like the Hostal Bruña, cheap, clean, and family run, but it's not a terrific location for your arrival. Its nearest metro is Antón Martín and that´s not very convenient. The best way to get there would be to take Cercanías to Sol and then either the metro or it´s about a km walk from Sol. It´s also about 1 km from Atocha, and it´s a very nice walk down the Paseo del Prado from the hostal to the train station. The Bruña is in what´s called the Letras district, lots of good restaurants, cafes, and if you ask for an interior room you won´t hear a sound.
Hope this gets you started. Buen camino, Laurie