The Mogosoaia railroad station is quite remote from the Mogosoaia Palace. It is not even in the town so you must return some kilometers to reach the settlement.
If you take the train from Bucharest (a 15 minutes trip), afer descending from it in the Mogosoaia station, fallow the straight railroad backwards until you reach the main street. From there you should easily find the way if you go right.
If you don't have a car, then public transportation is your best choice. There are daily trains leaving from Gara de Nord at 8,45 and 14,20 and the journey takes 15 minutes, last return at 17,48 at about 2 lei (check www.cfr.ro). Once you arrive in Mogosoaia station, beware that the palace is within a mile distance. To get there, don't rely on the advice of the employee in the railway station as he might be drunk or he may give you wrong directions for amusement. Just follow the passengers who got off the train (walk the rail lines backwards and then turn left at the first road, towards the houses). The castle is near the cemetery, in the centre of the village and it is advertised on the main road.
For the way back to Bucharest, just return to the main road and wait for a bus in the station. There are private buses called "maxi-taxi", but although don't have an official timetable, they come pretty quickly. You should not wait more then 20 minutes and nor should you pay more than incoming (2 lei). Normally, going back takes 30-40 minutes and you should get off the bus at Piata Chibrit (in front of the subway station).
Because of the many gipsies you'll definitely find in the bus, i would not recommend travelling late after sunset.