How long does it usually take for eye swelling and bruises to go after getting hit by ball?

It depends. Depending on the extent of the trauma it can take a few days or up to a couple of weeks. If any bones were broken around the eye socket it can take longer. If you were hit in the eye area by a ball and your eyelids are swollen shut or swollen significantly it is entirely possible that there has been damage to the eye itself and you must see an eye md immediately.