Yes, that’s right, the length matters, but the main thing is the cable category. For example,
cat 5e speed - up to 1 Gbps at a distance of up to 100 meters. This is now the minimum standard, and it is quite sufficient for home use. If you want something “for growth”, you can take Cat 6 - it supports up to 10 Gbps, but only on short sections (up to 55 m). For your case, if you plan to pull it around the apartment and you have a regular gigabit Internet, take Cat 5e - you will not overpay, and the speed will be stable. It is also important to consider the environment - if there are electrical appliances nearby, it is better to take a shielded version.