The 20-year-old made his breakthrough into the Rossoneri first team last season, finding the net 14 times before the start of the winter break in Serie A.
However, the Italian international only added two more to his tally before the end of the season.
Allegri has warned critics that El Shaarawy is still a young man, and believes that the goals will come if he continues to work hard on the training pitch.
"El Shaarawy just has to keep working," Football Italia quotes the 45-year-old as saying. "He was thrown into the limelight at a young age and he needs to find the right balance and remain relaxed.
"He is training well and he has done good things and things less well in matches as everyone has. He just needs to stay focused.
"Everyone needs to question themselves each day and you have to keep looking to the future. Stephan has all the qualities to get back to how he was playing last year."
El Shaarawy made his debut for the Azzurri in their 2-1 defeat to England a year ago.