Hens start laying eggs around five months of age and do not even need a rooster in order to produce eggs (although they will not hatch). As she gets older she will lay fewer eggs each year, and many hens stop laying in the winter.
Certain breeds of chickens are friendlier than others, so breed selection when you want a pet is key. Note that it might seem nice to rescue former battery hens (those used for massive egg production) however these hens have limited human contact and were not bred to be "pets" and as such wont be as relaxed or friendly.
The friendliest chickens tend to be those of quieter breeds that were raised in incubators where they may have been regularly handled. Chickens are easily befriended by offering them chicken scratch only when you are with them - of course they need proper laying ration at other times - and do best when allowed to free range in the day. The do need protection at night - in the form of a chicken coop, with roosting areas, and a laying box.
For keeping chickens as pets I strongly suggest getting 3 or 4 hens, or if you are getting a rooster and want to raise chicks you may want 1 rooster and two hens.
Be sure to check the laws in your area to make sure chickens are allowed as pets.
One of my favorite breeds of chicken for pets and for chicks, is the Silkie. For a friendly hen with good egg production consider a ISA Brown or Red Sussex. Look for Easter Eggers if you want a mix of colored eggs (even blue).
Cute Pets: The Silkie Chicken