Running a DC motor with PWM

This is what I am using but still not working. I can't get it to stop once it reaches the 255

int PWMpin = 13;
void setup()
{
}
void loop()
{
for (int i=0; i <= 255; i++){
analogWrite(PWMpin, i);
delay(10);
}
}