The short answer for rats
Yes, without much qualification. Rats are group animals in their bones: they live in colonies in the wild, and the pet rat has kept the full social programme. A rat needs at least one other rat — same sex, unless someone is neutered — and does better still in a small group. This is not a preference you can substitute with extra handling. You are a rat's favourite person, but you cannot sleep in a hammock pile with it, groom behind its ears at midnight, or answer it in the constant low-level chatter rats keep up between themselves.
What rat company actually looks like
Watch a settled group and the need explains itself. Rats sleep in contact, often in a literal heap, and wake to groom each other thoroughly, including the face and ears a rat cannot reach well alone. They play-wrestle, chase, and pin each other in bouts that look alarming until you learn that the pinned rat usually comes back for more. They also settle each other: a nervous rat takes courage from a calm cage mate at the vet, in a new cage, or during fireworks season. A single rat gets none of this regulation. Studies and rescue experience point the same way — lone rats are more often withdrawn, jumpy or listless, and some over-groom themselves bare patches from stress.
Why your attention is not a substitute
The kindest objection to the pair rule is the owner who plans to have the rat out all evening, every evening. It helps, genuinely, and rats should get that time regardless. But it still leaves the long night hours — rats are most active when you are asleep — and every working day, with an animal whose social needs run around the clock. There is also the matter of language. Rats communicate in postures, scents and sounds pitched largely above human hearing, and they are constantly negotiating status, comfort and play with each other. However bonded to you a lone rat becomes, it is living in a silent house. Company of its own kind is the one enrichment you cannot personally provide.
Introductions: how new rats join a group
Adult rats, especially males, should not simply be dropped into an occupied cage — the cage is territory, and the residents will defend it. The usual path starts in neutral space neither rat owns: a bathtub or playpen with treats scattered, short sessions, watching for relaxed eating and grooming rather than raised fur, sidling and teeth-chattering. Keepers then often move pairs into a small, bare, freshly cleaned carrier or cage for a day or two, where there is nothing to guard and the only entertainment is each other, before upgrading to the full cleaned cage with furniture added back gradually. Babies are usually accepted far faster than adults. Patience at this stage is the whole game: a forced introduction can set a pair back weeks, while a gradual one often ends with rats asleep in a pile by the end of the week.
How many rats make a good group
Two is the working minimum — each rat has a companion, and neither is ever left alone by accident of timing. Three or more is often better still: the social load spreads, a rat who loses a cage mate is not suddenly single, and the group dynamic softens any one personality. What matters as the group grows is cage size, multiple water bottles and food scattered rather than served in one defensible bowl, and same-sex housing planned carefully, since rats breed astonishingly fast. If a freeze, a squeak or a sideways push during a neutral-space introduction leaves you unsure whether it is normal, a remaining question can be put to KinsLe's Kimmy as a follow-up; she answers using the KinsLe Answers library.