If you use ' am' and ' pm' or ' AM' and ' PM' the space should be non breaking. The moment a copy-editor turns the page an 'am' at the start of a line will leap up shouting "Grammar Alert". Similarly an AM or PM at the start of a line will be waving a purple highlight pen
Some style guides (including CMOS as I recall) recommend avoidance of
unnecessary precision - i.e. 'just after eleven in the morning blah-de-blah…' rather than 'at 11:09 a.m. blah-de-blah…'
BR