The production of electrons from heavy-flavour hadron decays was measured as a function of transverse momentum (\(p_{\rm T}\)) in minimum-bias p-Pb collisions at \(\sqrt{s_{\rm NN}}=5.02\) TeV with ALICE at the LHC. The measurement covers the \(p_{\rm T}\) interval \(0.5<p_{\rm T}<12\) GeV/\(c\) and the rapidity range \(-1.06 < y_{\rm cms} < 0.14\) in the centre-of-mass reference frame. The contribution of electrons from background sources was subtracted using an invariant mass approach. The nuclear modification factor \(R_{\rm pPb}\) was calculated by comparing the \(p_{\rm T}\)-differential invariant cross section in p-Pb collisions to a pp reference at the same centre-of-mass energy, which was obtained by interpolating measurements at \(\sqrt{s}= 2.76\) TeV and \(\sqrt{s} =7\) TeV. The \(R_{\rm pPb}\) is consistent with unity within uncertainties of about 25%, which become larger for \(p_{\rm T}\) below 1 GeV/\(c\). The measurement shows that heavy-flavour production is consistent with binary scaling, so that a suppression in the high-\(p_{\rm T}\) yield in Pb-Pb collisions has to be attributed to effects induced by the hot medium produced in the final state. The data in p-Pb collisions are described by recent model calculations that include cold nuclear matter effects.