Welcome to the hobby. To specifically answer your question, it certainly does help to buy the games you are playing (but not necessarily every book). It is, however, not necessary. Most games run are by those who pick up a new game and sell their group on it. For example, I'm running Hackmaster (a fantasy game) for my local group. I'm the only person who owns the book and will likely be so for some time. Year ago, I introduced the group to Deadlands: Hell on Earth (a post-apocalypse/supernatural game). Eventually, quite a few of the players bought the main rulebook and a number of expansions.
The best advice I can give is to decide what kind of game you want to play, and start searching from there. RPG.net has a lot of reviews on available games. You are far better off picking a genre you like, finding a game that plays in that genre, and then looking for a group. Not only will you find a game you are more likely to enjoy, you will learn about what this hobby offers. D&D is a fine game, but it is by no means the only offering.
I hope that helps you get started. I'm just getting my feet wet on this site, so I can't offer a spot in a game.