The problem with contributions
Imagine you start with €1,000 and in a year it rises to €1,100: 10 %. At the end of the year you put in €10,000 more and, the next month, the portfolio falls 5 %. Now you have €10,545.
If you compare what you have with what you've put in (€11,000), it looks like you're losing 4 %. But your investment decisions haven't gone that badly: you made the 10 % with little money and lost the 5 % with a lot. You need measures that separate how the investment has done from when you put the money in.
Time-weighted: how the portfolio has done
The time-weighted return measures each stretch between contributions separately and chains them together. In the example: +10 % and then −5 % gives +4,5 %, regardless of how much money there was in each stretch.
It's the one funds use to report their return, and the one to use to compare yourself with an index: it answers «have I done better or worse than the market?».
Money-weighted: how it has gone for you
The money-weighted return (or IRR) does take into account how much money there was at each moment. In the example it comes out negative, because the fall caught almost all your money inside.
It's neither better nor worse than the other: it answers another question, «how much has my money earned?». If the two differ a lot, the timing of your contributions has mattered.
Don't forget inflation
5 % a year with 3 % inflation is, in purchasing power, around 2 %. To know whether you're really gaining, subtract inflation (or better, compare with the inflation calculator).
And costs
Purchase fees, custody, fund charges… 1 % a year in costs seems little, but over 30 years it eats a large part of the result through compound interest. Make sure the return you look at has them deducted.
Quick questions
Which return do I use to compare myself with an index?
The time-weighted one, because it doesn't depend on when you put money in or took it out, just like that of indices and funds.
Why does my broker show a different figure?
Many brokers show the difference between what it's worth and what you've put in, which mixes the result with the timing of your contributions.
General information to understand how it works, not financial or tax advice. Rules change and every case has nuances: for your return, confirm with the Spanish Tax Agency or an adviser.