An FFT is an optimization for computing the DFT that works well for any number of samples that is the product of mostly small prime number factors. They produce the exact same results, except for numerical noise. The factor 2 is common, but 3 and 5 are also small primes that can be used in a very efficient odd number length FFT implementation. Many newer FFT libraries (Accelerate/vDSP, FFTW, etc.) thus support odd length FFTs, not just powers of 2. On newer processors, the speed of an FFT is more limited by data cache size and policy and CPU instruction pipeline depth and hazards, not by the input being only a power-or-2 or not.
The algorithm makes no assumption about the signal being periodic (although some people do), as it is just a finite matrix basis transform. If the signal input isn't exactly integer periodic in the FFT width, with that width being cut out of a longer signal, then there will be some windowing artifacts, often called spectral leakage (but they have the exact shape as the transform of the window used, so they are far more related to the window than to the spectrum.)
If you change the size of a DFT or FFT window so that it is an exact integer multiple of the period of a purely periodic input waveform, then the windowing artifacts (or leakage) just happens to be all zeros.