I will begin this article by saying that you should check with the place where you plan to take lessons. They might have specific expectations of what they want you to have.
In that case, it is easy, if you don't have everything on their list, go buy it. If the place you are taking lessons from is less formal, they might not give you a lot of guidance on what exactly you need to have. Just because a farm doesn't have an expensive dress code does not mean that it isn't a great place to learn to ride.
Let's say you chose a family-owned small barn. They don't have a formal dress code or expectations about what you should wear. If this is the case, we want functional and comfortable.
As far as pants go, I recommend leggings or jeans if you don't want to purchase riding breeches. You could even ride in sweatpants if they aren't too baggy or bunchy.
In my opinion, breeches are the first choice. Leggings would be second choice and jeans last. The reason why I say jeans would be last in my opinion is that the seams they have on the inner leg can rub your leg raw, which gets uncomfortable pretty quickly.
As far as shirts go, the main thing is that you are wearing something comfortable. Something you can move in easily. Just make sure it is not so big and baggy that your instructor can't see your upper body position. If it is a long sleeve shirt or a longer t-shirt, it should be tucked in, so your instructor can better check your position. Some trainers allow their students to ride in tank tops in the summer. Most likely, if your farm doesn't have a picky dress code, they probably don't mind tank tops. In my opinion, tank tops are okay if you are riding in the ring. They aren't, however, so great for trail rides. You'll likely get scratched by branches and you're much more susceptible to bug bits.
Boots are super important. If you don't want to go to the tack store and buy expensive riding clothes, that is fine. You don't have to buy the most expensive, top of the line boots they have. Most tack stores have a variety of price points for different sorts of riders. You just need a boot that is comfortable on your foot. It definitely doesn't have to be the most popular name brand. They all end up dirty and stepping in horse manure in the end anyway!
The reason why I think it is important to have boots specific for riding is because—besides a helmet, of course—your boots play most into your safety. A riding boot is grippy enough to hold the boot in the stirrup, but not so much that the stirrup could get caught on the soles. Riding boots will fit better into the stirrups than most hiking boots or work boots you might find, making them much safer.
You need a helmet. Whether you borrow it from your lesson barn or go buy one, you need to wear a helmet. Most lesson barns won't give you a choice in this matter. No helmet, no lessons! If the barn has helmets you can use and you want to go that route for now, that's fine.
Just like boots and everything else at the tack store, helmets should be able to be found at different price points. You should be able to find one in your price range that you like.
Another thing you might want for lessons is riding gloves. This is really just a matter of preference. Some people are more comfortable with gloves on and feel they can grip better. Other people don't like wearing gloves, especially in the summer when it is hot. Sometimes it can depend on the horse. If the horse you ride pulls a lot, having gloves might be helpful. Gloves, unless specified, are not something you need to show up with for your first lesson.
If you decide to stick with horses and riding, and you want to buy more, the tack stores are full of riding clothes and horse equipment just waiting to be bought. For now, though, this is a good safe start with the basics.