If you have plants, lights should be on long enough so the plants long enough for them to have sufficient light to grow, but not too long to have excessive algae growth. This is something you would have to find for yourself, but typically 6 to 8 hours is the sweet spot.
If you dont have plants, then have the lights on for long enough to not have excessive plants growth. Again you would need to find this balance for yourself, but if its more than 8 hours that probably too much.
If green water is being caused by too much light, its usually because there is way too much light, not just going a bit overboard. That usually means direct sunlight. Sunlight is a lot more powerful than aquarium lights and even a short amount of time in direct sunlight can cause green water. Does the tank get any direct sunlight? How far from a window is it?
How to clear things up? Over a extended period, possibly months, getting the lighting right should help things, but once your water is going green and the algae is in there it wont be a quick fix. If you dont have live plants you could completely black out the tank for a week or so. No light in there whatsoever, feed in the dark. A UV light can help if you cant black out the tank.
Just to double check. Its green water right? Not a tea like brown colour? Can you post a photo?