Is this what you want to do?
library(tidyverse)
library(lubridate)
squads <- tibble::tribble(
~Zeit, ~Jahr2020, ~Jahr2019,
"01.04.2020 02:00", 5.54, 9.54,
"01.04.2020 03:00", 8.28, 7.61,
"01.04.2020 04:00", 32.45, 7.17,
"01.04.2020 05:00", 51.82, 11.95,
"01.04.2020 06:00", 80, 22.05,
"01.04.2020 07:00", 55.08, 36.71,
"01.04.2020 08:00", 36.26, 35.33,
"01.04.2020 09:00", 23.68, 43.09,
"01.04.2020 10:00", 14.75, 22.36,
"01.04.2020 11:00", 19.8, 15.32,
"01.04.2020 12:00", 21.45, 14.46,
"01.04.2020 13:00", 25.08, 16.53,
"01.04.2020 14:00", 19.79, 19.9,
"01.04.2020 15:00", 23.12, 18.26,
"01.04.2020 16:00", 29.92, 24.09,
"01.04.2020 17:00", 19.88, 19.98,
"01.04.2020 18:00", 14.66, 20.61,
"01.04.2020 19:00", 15.21, 17.13,
"01.04.2020 20:00", 11.43, 21.62,
"01.04.2020 21:00", 10.29, 19.39,
"01.04.2020 22:00", 10.32, 18.85,
"01.04.2020 23:00", 10.28, 16.72,
"02.04.2020 00:00", 12.03, 26.86,
"02.04.2020 01:00", 14.29, 31.46,
"02.04.2020 02:00", 11.45, 14.02,
"02.04.2020 03:00", 13.4, 11.61,
"02.04.2020 04:00", 15.22, 15.52,
"02.04.2020 05:00", 41.96, 30.27
)
squads %>%
mutate(Zeit = dmy_hm(Zeit)) %>%
ggplot(aes(x=Zeit)) +
geom_line(aes(y=Jahr2019, color="Jahr2019", linetype="Jahr2019")) +
geom_line(aes(y=Jahr2020, color="Jahr2020", linetype="Jahr2020")) +
geom_hline(aes(color = "Mittelwert2019",
yintercept = 28.72,
linetype = "Mittelwert2019"),
size = 0.5) +
geom_hline(aes(color="Mittelwert2020",
yintercept = 17.01,
linetype = "Mittelwert2020"),
size = 0.5) +
ylim(0,130)+
ggtitle("Peak-Analyse Stickoxide Balsberg 2019 & 2020") +
labs(x="time",
y=" Stickoxide NOx parts per billion[ppb]",
linetype = "Variable",
color = "Variable")+
scale_color_manual(name="Variable",
breaks = c("Jahr2019", "Jahr2020", "Mittelwert2019", "Mittelwert2020"),
values = c("Jahr2019" = "red", "Jahr2020" = "darkgreen", "Mittelwert2019"="Red","Mittelwert2020"="Darkgreen")) +
scale_linetype_manual(breaks = c("Jahr2019", "Jahr2020", "Mittelwert2019", "Mittelwert2020"),
values = c("Jahr2019" = "solid", "Jahr2020" = "solid", "Mittelwert2019"="dashed","Mittelwert2020"="dashed")) +
theme_minimal()

Created on 2020-05-02 by the reprex package (v0.3.0)