Cooked eggs are fine for cats. They're a decent protein source, and cats — being obligate carnivores — generally do well with animal protein. Plain scrambled egg or a bite of hard-boiled egg won't hurt them and some cats find it appealing.
Raw eggs are a different situation. The short version: cook the eggs.
Why raw eggs are a problem
Raw egg whites contain avidin — a protein that binds to biotin and prevents cats from absorbing it. Biotin (vitamin B7) is important for skin, coat, and cellular function. A cat that occasionally gets a raw egg probably won't develop a deficiency, but if raw eggs become a regular thing, biotin deficiency can develop over time. Symptoms include hair loss, scaly skin, and fatigue.
Cooked egg whites don't have this problem. Heat denatures avidin and makes the egg fully safe and nutritious.
Salmonella is also worth mentioning — cats can get it, and while they're generally hardier than humans about foodborne bacteria, there's no reason to take the risk when cooked eggs are equally good.
How to give it to them
Plain. Scrambled with no butter or salt, or a few pieces of hard-boiled egg white and yolk. No onion, no garlic, no seasoning — those are toxic to cats. Eggs cooked how you'd cook them for yourself almost always have additions that cats shouldn't have.
A tablespoon or two of scrambled egg is plenty. Cats are small, and egg is calorie-dense. A few times a week at most if you're giving it regularly; otherwise it's a fine occasional treat.
If you're looking for other high-protein treats cats tend to like, plain cooked chicken is the gold standard — lean, well-tolerated, and most cats go crazy for it. Tuna is another popular option, though with its own caveats around mercury and overfeeding.