The Large Area Telescope onboard the Fermi Gamma-ray Space Telescope has collected more than 15 millions of cosmic-ray electron and positron (CRE) events in the energy range from 42 GeV to 2 TeV in about 7.5 years since its launch in 2008. We have searched for possible features in the energy spectrum of Galactic CREs, which could be interpreted as a signature of the presence of a nearby dark matter source. A similar search has been performed looking at the energy spectrum of CREs towards the Sun. No significant DM signal was detected and we set constraints on the velocity averaged dark matter annihilation cross section into electron-positron pairs and on the dark matter-nucleon scattering cross section in the case of DM captured by the Sun. The last results have been derived assuming two different models: 1) elastic scatterings of dark matter particles with nuclei creating an overdensity of dark matter particles in the core of the Sun, which annihilate into long-lived light mediators decaying into e+e- pairs outside the Sun; 2) inelastic scatterings of dark matter particles with solar nuclei, which yield an enhanced density of dark matter particles around the Sun annihilating directly into e+e- pairs.