We present upper limits on the production of heavy neutral leptons (HNLs) decaying to μπ pairs using data collected with the MicroBooNE liquid-argon time projection chamber (TPC) operating at Fermilab. This search is the first of its kind performed in a liquid-argon TPC. We use data collected in 2017 and 2018 corresponding to an exposure of 2.0×1020 protons on target from the Fermilab Booster Neutrino Beam, which produces mainly muon neutrinos with an average energy of ≈800 MeV. HNLs with higher mass are expected to have a longer time of flight to the liquid-argon TPC than Standard Model neutrinos. The data are therefore recorded with a dedicated trigger configured to detect HNL decays that occur after the neutrino spill reaches the detector. We set upper limits at the 90% confidence level on the element |Uμ4|2 of the extended PMNS mixing matrix in the range |Uμ4|2<(6.6-0.9)×10-7 for Dirac HNLs and |Uμ4|2<(4.7-0.7)×10-7 for Majorana HNLs, assuming HNL masses between 260 and 385 MeV and |Ue4|2=|Uτ4|2=0.