The full-back, who has been capped by Northern Ireland, can count MK Dons and Kilmarnock among his former clubs and could make his debut for Saints against Livingston on Saturday.
Buddies boss Alan Stubbs told the club website: "Lee brings experience, a winning mentality and his own individual qualities. It's one we've been keen to do for the last few weeks."