Is it better to reply to 1.Nf3 with ...d5 or ...b5? After 1.Nf3 I can gain space with either of 1...d5 or 1...b5. Which of these two is better?

I presume it's 1...d5, but I just want to make sure.
After 1.Nf3 the most popular answer is 1…Nf6, which is a hundred times more common than 1…b5. 1…d5 is the second most popular choice, still fifty times more likely to appear on the board than 1…b5.

Now the difference between 1…Nf6 and 1…d5 is mostly one of compatibility with the rest of your opening repertoire. 1…Nf6 is more common because the indian defences are more popular than the 1…d5 against 1.d4.

But 1…b5 is decidedly offbeat. The reason is that it doesn't immediately fight for control of the central squares. The importance of the central squares is explained in the answers to this question: 
Why is the centre of the board considered important in chess?

Still, 1…b5 isn't a mistake. It has the ideas of developing the bishop to b7, making c4 impossible and maybe annoy a Nc3 in the future. If black can consolidate, the additional space on the queenside might make a difference.

The main problem from a theoretical standpoint is probably that it is rather slow: 1.Nf3 b5 2.e4 Bb7 3.Bxb5 Bxe4 4.Nc3 Bb7 5.O-O and white has quite a significant development lead.