Donec eris felix multos numerabis amicos.
Tempora si fuerint nubila solus eris.
It was written by the great Roman poet Publius Ovidius Naso, known in English as Ovid.
It roughly translates as:
While you will be lucky you will be counting your many friends.
(But) If times should turn gloomy you will be alone.