There is no way of knowing. Taphath and Basemath (or Basmath KJV) are only mentioned once each in the Bible (1 Kings 4:11,15) and then it is only to tell us who they married.
We know that Solomon’s son Rehoboam was 41 years old when Solomon died (1 Kings 14:21), and that Solomon died when in his 60s (see “How old was Solomon when he began his reign?”). Therefore, Rehoboam was born when Solomon was in his 20s. But we can’t tell whether Taphath and Basemath were born before or after Rehoboam.