Your 10k running time can give you a good idea of a per-mile pace you could sustain for a marathon, but you also have to do the endurance training to be able to complete 26.2 miles. Moderately trained runners can complete a 10k race by running at their lactate threshold pace. This is the maximum sustainable pace your aerobic system can handle, and running faster than this pace leaves you gasping at the side of the trail.
Running at your lactate threshold pace burns a lot of energy very quickly, which is why people have to run slower per-mile paces as competitions get longer. Since a marathon is 20 miles longer than a 10k race (6.2 miles), your per-mile pace needs to be slower than your 10k pace by about 10 percent.
For example, if you run seven-minute miles for a 10k, your per-mile pace for a marathon would be 7:40-7:45. Running 26.2 miles at a 7:40 - 7:45 pace would give you a marathon finishing time of 3:20:53 to 3:23:03. Of course, there are a ton of variables that will affect your marathon time, including weather, terrain, what you eat and drink, and the simple fact that you're running 26.2 miles instead of only 6.2! At the end of the day, the 10 percent calculation will only give you a ballpark estimate of how fast you could expect to run a marathon. To find out your real time, you're going to have to step up to the start line and give it a try.