I would like to travel to Ecuador but I don't know if it is safe to go there because of the earthquakes of the last days.
In case I can't visit this country know, how much should I wait till I could travel there without any risk?
After a major earthquake, the area typically experiences aftershocks for quite some time. Every earthquake series is different, but by way of example consider the 2010 Christchurch earthquakes. The largest one (the first of the series) was a 7.1 in September 2010. The most destructive was a 6.3 five months later, in February 2011. There have been 65 quakes over magnitude 5.0 since then, the most recent in March 2016.
If you visit the affected coastal areas of Ecuador for the next few years, you are likely to experience earthquakes of some magnitude.
As far as personal safety, as long as you don't do risky things like entering damaged buildings in quake-prone areas, you should be fine. Everything that is likely to collapse probably already has, but no guarantees.