Madrid is a reasonable city compared to other major capitals such as London, Paris or Rome.
Having a cup of coffee can cost anything from 1€ and 1,80€, a three course meal in Madrid tends to cost between 9€ and 15€ depending on the establishment. A delicious and traditional chocolate with churros costs between 3€ and 6€. Travelling by the underground is also fairly cheap since a single ticket costs between 1,50€ and 2€ and the monthly underground-bus ticket costs 35€ (if you are under 25 years old).
If you want to watch a film in one the many modern cinemas in Madrid, the entrance fee is 5€-10€, depending on the day and time.
Like every capital, there are areas that are cheaper than others, making it very likely that you won’t face any financial strain. Learning Spanish in Spain is within your reach!