"Have a good day" is usually said to someone who is leaving, like when going out of their home or a shop, or when ending a phone call. It's not said after evening/sunset.
"Have a good one" is usually said to someone who is about to engage in an specific activity, like going to a sports match or a party.