Not like real life, chickens in Minecraft do not need sunlight to lay eggs. But you must wait between 5-10 minutes and they will lay eggs.