Quoting hola1234
hmm my plane arrives to amman at the afternoon, so i will leave the next morning to visit Petra
I would try to make it to Petra (Wadi Musa) on the same day as you arrive in Amman. If you are willing to shell out a bit (say around 60 USD) you can take a private taxi from the airport to Petra. Or better, rent a car. (Yes, it is safe to drive in Jordan, just do not pick up any hitchhikers if you are a single woman.)
You can also go by service taxi, that should be cheaper (around 20 USD). Go to the South Bus Station (Mojama' al-Janoob) in Amman to catch a "service" (pronounced sirfees) to either Ma'an or Wadi Musa.
http://www.go2petra.com/guide_trans.htm
I've been to Petra and from my experience you can easily spent 3 days in the ruins. 1 full day is the minimum, plus you need to get up early (6 am) to beat the heat. The only way to do that is to sleep in Wadi Musa the night before you visit Petra.
More tips: Try to get your ticket in advance so that you do not have to wait in line in the morning (I don't know if this is still possible). Pay for a donkey or mule to take you to the "monastery" (El Deir), then walk back to the entrance.
Personally and ideally I would plan on 3 weeks for Egypt and Jordan. I would travel from Amman overland to Cairo, taking my time to visit all the sights in between and then all the major sights in Egypt.