I'm assuming you have hair algae, 'cause you said it looked like hair, good guess I would say. Heh, anyways reducing the photoperiod will help but not get rid of the hair algae.
What I'd suggest is carry out more water changes, hair algae thrive when there's high levels of nitrAtes, try to avoid overfeeding, meaning make sure your Betta eats all the food you give him, uneaten food will contribute to poor water condition and also higher nitrAte levels.
If you can try getting live plants, easy low-light plants like java fern, marimo moss balls, or any type of moss will help. Live plants will outcompete the algae in your tank for nutrients.
Also Nerite snails are excellent algae eaters, better than the more commonly sold Apple/Mystery snails. They eat algae mostly, you'll be able to house one in your 5g. They're relatively easy to take care of, it eats primarily algae, once your tank runs out of algae you'll have to feed it algae wafers, supplement it's diet with blanched veggies like spinach, or zucchinis, they're high in calcium and will help maintain the shell.
You may have to up the amount of water changes, but 50% water changes with one Nerite snail and one Betta is probably okay, especially if you established a cycle already, which I'm hoping you have.