You forgot to set 'i' back to 0 after you process the input.
You should also put a null terminator on the string before you convert to a number.
You should also allow for values less than four characters.
Something like this should work (not tested):
void loop() {
// send data only when you receive data:
if (Serial.available())
{
dados[i] = Serial.read();
if (isdigit(dados[i]))
i++;
else
if (i > 0) // Make sure we have some digits
{
dados[i] = '\0'; // Add null terminator
recebido = atoi(dados);
i = 0;
analogWrite(9,recebido);
Serial.print("dir: ");
Serial.println(recebido);
delay(500);
}
else
{
analogWrite (9, 0);
}
}
}