Attacks on your planets can happen all the time., esspecially if you've alerted AI planets (planets that are adjacent to your own planets).
Since the turret cap has changed to planet-cap instead of galaxy-cap you should put on every planet you own some basic defenses. Keep in mind that turrets does cost energy and you can only get a certain amount of energy for free on your planets. Everything above that has a hefty metal cost that got substracted from your income.
So it is wise to put on every planet you own some basic defenses but focus on heavy defenses only on important planets or planets you want as chokepoints.
You should consider playcing tractor beam turrets because they hold enemy ships in place, giving you time to react. However, the ships does only stop to move and there are still ships that can bypass tractor beams. Ships can still attack and use special abillities normally.
If you want however to stop enemies for good, use spider turrets. They target the engine and ships that are immune to tractor beams are not immune to engine damage.
Beware that stopping the enemy won't be enough, you still need fire power. Combine different turrets so you can defeat different enemy ships. When a wave is announced, watch out what ship types enter. You might want to reinforce your defenses until the wave arrives.
And I cannot stress this out enough, always look at the stats of you and your enemy ships. It might seem very much but it helps if you look at the hull types and the attack multipliers. That alone can tell you what ship is excellent against another ship.
The basic triangle is Fighter>Bomber>Frigate>Fighter (like Rock-Paper-Scissors) and there are tons of bonus ships (esspecially if you own any of the expansions) that behave similiar.
Try tounderstand the different roles from the ships. Fighters are fast and agile, bombers bomb the shit out of structures and heavy ships, missile frigates are slow, fire slow but have a huge range with auto-targeting missiles making them excellent for an early artillery unit.
Also, don't try to use every unit in a huge blob. This works on easier difficulties but on higher difficulties it's better to divede your units so they can fulfill their role (you don't want the fragile frigates fight in the front line as an example).
And again, whenever you encounter a new ship, first thing to check put is it's description. Knowledge is very important in this game, you have to know what you encounter.