Limit cycles and critical periods for some polynomial differential equations