For example, I need to be at a place at 7:00, but got there at 8:00. Can I say "I got there late by an hour"? I know a more commonly used expression is "I was an hour late", but for now I only want to know whether the one I suggested is correct.
As you've already mentioned, it's not common, but I think it's OK grammatically. Ref.
I would add a comma to make it clearer:
I got there late, by an hour.