The port count is the simple part, though there is a catch. Typically, you'll use one port to connect the switch to your router, leaving four ports for other devices on a five-port switch. If you need four more ports right now, an eight-port switch (with room for seven devices) gives more breathing room for future devices.
Speed takes a little more thought. If your internet connection, router and wired devices all max out at Gigabit speeds, then a 1GbE switch is perfectly reasonable. If you have multi-gig internet, a newer PC with 2.5GbE or a fast NAS with multi-gig networking, then a 2.5GbE switch makes more sense. It also avoids jumping up to pricier 10GbE hardware if you don't really need that.
What's vital is that the switch shouldn't become the bottleneck. If the router has a 2.5Gbps port and the switch is limited to 1GbE, the traffic between the router and switch will be limited to 1GbE. The same applies at the other end: plugging a device with a 1GbE port into a 2.5GbE switch doesn't magically make it faster.
Internet speed isn't the whole story, either. Two 10GbE-capable devices connected to the same 10GbE switch can move files across your local network much faster than your internet plan allows, which can matter for large NAS backups or video files. And 2.5GBASE-T can run over existing Cat5e cabling, so moving beyond Gigabit doesn't necessarily mean rewiring the house.