If you switch teams in the middle of a Breeding, Fortification Frenzy, or Feeding event, your points will stay with your previous team. Any new points you earn will only count towards your new team if said team are in the same league as your previous team. At the end of the event, you will be able to receive the rewards earned based on your new team's ranking.
If you leave your team after the event starts and before you received your team prizes, then you will not receive your team prizes for the team you earned points for.
For PvP-based events like Fight Pits, Team Gauntlet, Kingdom Wars, players cannot score after switching teams.