Research is split into 3 sections - Military, Civilian, and Fleet Logistics.
Military and Civilian tech trees need their corresponding lab stations, Fleet Logistics isn't specific, as long as you've got 1 of any kind you can start researching.
Each "tier" in the Military/Civic trees (read left > right for tier progression) is equivalent to 1 lab. There are 8 tiers possible, so at most you will need 8 of the corresponding lab type to research the highest tier techs in that tree.
For example, the TEC's Novalith cannon is tier 8, and needs 8 military labs before you can research it and the pre-requisite tech.
The more advanced mechanic is that you need to maintain the right number of labs to keep building units/buildings that you researched, and fire the superweapons. For example, if you need 5 labs to research the Kodiak cruiser, you need to keep 5 labs to be able to build it. If you ever fall below 5, you won't be able to make new ones.
Passive techs and upgrades aren't affected by that, only ship hulls and building types (and the superweapons firing).
As for the planets, different planets have varying amounts of possible Logistics slots, which you need to build either the military or civic labs. Asteroids can have 12 total, so 3 labs. Terrans can have 24, Volcanics 20 I think, Desert 36 - you can upgrade logistics through the planet upgrades menu. Looks like a gear

Hope that helps!