Know how long before it is no longer safe to sleep on my stomach if pregnant?

Practical and comfor. You may sleep on your stomach as long as it is comfortable. Later in pregnancy it may become impractical.
Comfort level. Eventually you will feel uncomfortable due to pain or breathing difficulty . In general , this will occur between the 16th and 20th week (in a singleton pregnancy).